Changeset ddb56be in mainline
- Timestamp:
- 2012-05-08T09:20:18Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4d194be
- Parents:
- c8d0f9e5
- Location:
- kernel/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/mm/slab.h
rc8d0f9e5 rddb56be 113 113 list_t full_slabs; /**< List of full slabs */ 114 114 list_t partial_slabs; /**< List of partial slabs */ 115 SPINLOCK_DECLARE(slablock);115 IRQ_SPINLOCK_DECLARE(slablock); 116 116 /* Magazines */ 117 117 list_t magazines; /**< List o full magazines */ -
kernel/generic/src/mm/slab.c
rc8d0f9e5 rddb56be 254 254 slab_t *slab) 255 255 { 256 ASSERT(interrupts_disabled());257 258 256 if (!slab) 259 257 slab = obj2slab(obj); … … 266 264 freed = cache->destructor(obj); 267 265 268 spinlock_lock(&cache->slablock);266 irq_spinlock_lock(&cache->slablock, true); 269 267 ASSERT(slab->available < cache->objects); 270 268 … … 277 275 /* Free associated memory */ 278 276 list_remove(&slab->link); 279 spinlock_unlock(&cache->slablock);277 irq_spinlock_unlock(&cache->slablock, true); 280 278 281 279 return freed + slab_space_free(cache, slab); … … 286 284 } 287 285 288 spinlock_unlock(&cache->slablock);286 irq_spinlock_unlock(&cache->slablock, true); 289 287 return freed; 290 288 } … … 297 295 NO_TRACE static void *slab_obj_create(slab_cache_t *cache, unsigned int flags) 298 296 { 299 ASSERT(interrupts_disabled()); 300 301 spinlock_lock(&cache->slablock); 297 irq_spinlock_lock(&cache->slablock, true); 302 298 303 299 slab_t *slab; … … 312 308 * 313 309 */ 314 spinlock_unlock(&cache->slablock);310 irq_spinlock_unlock(&cache->slablock, true); 315 311 slab = slab_space_alloc(cache, flags); 316 312 if (!slab) 317 313 return NULL; 318 314 319 spinlock_lock(&cache->slablock);315 irq_spinlock_lock(&cache->slablock, true); 320 316 } else { 321 317 slab = list_get_instance(list_first(&cache->partial_slabs), … … 333 329 list_prepend(&slab->link, &cache->partial_slabs); 334 330 335 spinlock_unlock(&cache->slablock);331 irq_spinlock_unlock(&cache->slablock, true); 336 332 337 333 if ((cache->constructor) && (cache->constructor(obj, flags))) { … … 632 628 list_initialize(&cache->magazines); 633 629 634 spinlock_initialize(&cache->slablock, "slab.cache.slablock");630 irq_spinlock_initialize(&cache->slablock, "slab.cache.slablock"); 635 631 spinlock_initialize(&cache->maglock, "slab.cache.maglock"); 636 632
Note:
See TracChangeset
for help on using the changeset viewer.