Changeset 25ebfbd in mainline
- Timestamp:
- 2012-05-06T19:34:33Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c8d0f9e5
- Parents:
- 1295a1da
- Location:
- kernel/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/mm/slab.h
r1295a1da r25ebfbd 81 81 slab_magazine_t *current; 82 82 slab_magazine_t *last; 83 SPINLOCK_DECLARE(lock);83 IRQ_SPINLOCK_DECLARE(lock); 84 84 } slab_mag_cache_t; 85 85 -
kernel/generic/src/mm/slab.c
r1295a1da r25ebfbd 366 366 atomic_dec(&cache->magazine_counter); 367 367 } 368 369 368 spinlock_unlock(&cache->maglock); 369 370 370 return mag; 371 371 } … … 414 414 slab_magazine_t *lastmag = cache->mag_cache[CPU->id].last; 415 415 416 ASSERT( spinlock_locked(&cache->mag_cache[CPU->id].lock));416 ASSERT(irq_spinlock_locked(&cache->mag_cache[CPU->id].lock)); 417 417 418 418 if (cmag) { /* First try local CPU magazines */ … … 451 451 return NULL; 452 452 453 spinlock_lock(&cache->mag_cache[CPU->id].lock);453 irq_spinlock_lock(&cache->mag_cache[CPU->id].lock, true); 454 454 455 455 slab_magazine_t *mag = get_full_current_mag(cache); 456 456 if (!mag) { 457 spinlock_unlock(&cache->mag_cache[CPU->id].lock);457 irq_spinlock_unlock(&cache->mag_cache[CPU->id].lock, true); 458 458 return NULL; 459 459 } 460 460 461 461 void *obj = mag->objs[--mag->busy]; 462 spinlock_unlock(&cache->mag_cache[CPU->id].lock);462 irq_spinlock_unlock(&cache->mag_cache[CPU->id].lock, true); 463 463 464 464 atomic_dec(&cache->cached_objs); … … 481 481 slab_magazine_t *lastmag = cache->mag_cache[CPU->id].last; 482 482 483 ASSERT( spinlock_locked(&cache->mag_cache[CPU->id].lock));483 ASSERT(irq_spinlock_locked(&cache->mag_cache[CPU->id].lock)); 484 484 485 485 if (cmag) { … … 531 531 return -1; 532 532 533 spinlock_lock(&cache->mag_cache[CPU->id].lock);533 irq_spinlock_lock(&cache->mag_cache[CPU->id].lock, true); 534 534 535 535 slab_magazine_t *mag = make_empty_current_mag(cache); 536 536 if (!mag) { 537 spinlock_unlock(&cache->mag_cache[CPU->id].lock);537 irq_spinlock_unlock(&cache->mag_cache[CPU->id].lock, true); 538 538 return -1; 539 539 } … … 541 541 mag->objs[mag->busy++] = obj; 542 542 543 spinlock_unlock(&cache->mag_cache[CPU->id].lock);543 irq_spinlock_unlock(&cache->mag_cache[CPU->id].lock, true); 544 544 545 545 atomic_inc(&cache->cached_objs); … … 593 593 for (i = 0; i < config.cpu_count; i++) { 594 594 memsetb(&cache->mag_cache[i], sizeof(cache->mag_cache[i]), 0); 595 spinlock_initialize(&cache->mag_cache[i].lock,595 irq_spinlock_initialize(&cache->mag_cache[i].lock, 596 596 "slab.cache.mag_cache[].lock"); 597 597 } … … 704 704 size_t i; 705 705 for (i = 0; i < config.cpu_count; i++) { 706 spinlock_lock(&cache->mag_cache[i].lock);706 irq_spinlock_lock(&cache->mag_cache[i].lock, true); 707 707 708 708 mag = cache->mag_cache[i].current; … … 716 716 cache->mag_cache[i].last = NULL; 717 717 718 spinlock_unlock(&cache->mag_cache[i].lock);718 irq_spinlock_unlock(&cache->mag_cache[i].lock, true); 719 719 } 720 720 }
Note:
See TracChangeset
for help on using the changeset viewer.