Changeset 81e52f2a in mainline for generic/src/mm/slab.c


Ignore:
Timestamp:
2006-02-04T00:53:19Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c5613b7
Parents:
c352c2e
Message:

Fixed non-initialized cpu-cache.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/mm/slab.c

    rc352c2e r81e52f2a  
    366366        void *obj;
    367367
     368        if (!CPU)
     369                return NULL;
     370
    368371        spinlock_lock(&cache->mag_cache[CPU->id].lock);
    369372
     
    436439        slab_magazine_t *mag;
    437440
     441        if (!CPU)
     442                return -1;
     443
    438444        spinlock_lock(&cache->mag_cache[CPU->id].lock);
    439445
     
    508514        spinlock_initialize(&cache->lock, "cachelock");
    509515        if (! (cache->flags & SLAB_CACHE_NOMAGAZINE)) {
    510                 for (i=0; i< config.cpu_count; i++)
     516                for (i=0; i< config.cpu_count; i++) {
     517                        memsetb((__address)&cache->mag_cache[i],
     518                                sizeof(cache->mag_cache[i]), 0);
    511519                        spinlock_initialize(&cache->mag_cache[i].lock,
    512520                                            "cpucachelock");
     521                }
    513522        }
    514523
     
    645654        ipl = interrupts_disable();
    646655
    647         if (!(cache->flags & SLAB_CACHE_NOMAGAZINE) && CPU)
     656        if (!(cache->flags & SLAB_CACHE_NOMAGAZINE))
    648657                result = magazine_obj_get(cache);
    649658
     
    670679
    671680        if ((cache->flags & SLAB_CACHE_NOMAGAZINE) \
    672             || !CPU \
    673681            || magazine_obj_put(cache, obj)) {
    674                
    675682                spinlock_lock(&cache->lock);
    676683                slab_obj_destroy(cache, obj, slab);
Note: See TracChangeset for help on using the changeset viewer.