Changeset 4d194be in mainline


Ignore:
Timestamp:
2012-05-08T09:31:18Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
905721b
Parents:
ddb56be
Message:

Convert slab_cache_t's maglock into an IRQ spinlock as it is taken from
a callpath called from slab_cache_destroy(), which does not disable
interrupts.

Location:
kernel/generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/mm/slab.h

    rddb56be r4d194be  
    116116        /* Magazines */
    117117        list_t magazines;  /**< List o full magazines */
    118         SPINLOCK_DECLARE(maglock);
     118        IRQ_SPINLOCK_DECLARE(maglock);
    119119       
    120120        /** CPU cache */
  • kernel/generic/src/mm/slab.c

    rddb56be r4d194be  
    355355        link_t *cur;
    356356       
    357         ASSERT(interrupts_disabled());
    358 
    359         spinlock_lock(&cache->maglock);
     357        irq_spinlock_lock(&cache->maglock, true);
    360358        if (!list_empty(&cache->magazines)) {
    361359                if (first)
     
    368366                atomic_dec(&cache->magazine_counter);
    369367        }
    370         spinlock_unlock(&cache->maglock);
     368        irq_spinlock_unlock(&cache->maglock, true);
    371369
    372370        return mag;
     
    379377    slab_magazine_t *mag)
    380378{
    381         ASSERT(interrupts_disabled());
    382 
    383         spinlock_lock(&cache->maglock);
     379        irq_spinlock_lock(&cache->maglock, true);
    384380       
    385381        list_prepend(&mag->link, &cache->magazines);
    386382        atomic_inc(&cache->magazine_counter);
    387383       
    388         spinlock_unlock(&cache->maglock);
     384        irq_spinlock_unlock(&cache->maglock, true);
    389385}
    390386
     
    629625       
    630626        irq_spinlock_initialize(&cache->slablock, "slab.cache.slablock");
    631         spinlock_initialize(&cache->maglock, "slab.cache.maglock");
     627        irq_spinlock_initialize(&cache->maglock, "slab.cache.maglock");
    632628       
    633629        if (!(cache->flags & SLAB_CACHE_NOMAGAZINE))
Note: See TracChangeset for help on using the changeset viewer.