Changeset e72b0a3 in mainline


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

Small fix in slab allocator for large-sized slabs.

Files:
2 edited

Legend:

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

    r3260ada re72b0a3  
    235235
    236236        ASSERT(slab->cache == cache);
     237        ASSERT(slab->available < cache->objects);
    237238
    238239        spinlock_lock(&cache->slablock);
     
    243244
    244245        /* Move it to correct list */
    245         if (slab->available == 1) {
    246                 /* It was in full, move to partial */
    247                 list_remove(&slab->link);
    248                 list_prepend(&slab->link, &cache->partial_slabs);
    249         }
    250246        if (slab->available == cache->objects) {
    251247                /* Free associated memory */
     
    255251                 * keep all locks */
    256252                frames = slab_space_free(cache, slab);
     253        } else if (slab->available == 1) {
     254                /* It was in full, move to partial */
     255                list_remove(&slab->link);
     256                list_prepend(&slab->link, &cache->partial_slabs);
    257257        }
    258258
     
    283283                spinlock_unlock(&cache->slablock);
    284284                slab = slab_space_alloc(cache, flags);
     285                if (!slab)
     286                        return NULL;
    285287                spinlock_lock(&cache->slablock);
    286                 if (!slab)
    287                         goto err;
    288288        } else {
    289289                slab = list_get_instance(cache->partial_slabs.next,
     
    302302        spinlock_unlock(&cache->slablock);
    303303        return obj;
    304 err:
    305         spinlock_unlock(&cache->slablock);
    306         return NULL;
    307304}
    308305
  • test/mm/slab2/test.c

    r3260ada re72b0a3  
    200200        multitest(128);
    201201        multitest(2048);
     202        multitest(8192);
    202203        printf("All done.\n");
    203204}
Note: See TracChangeset for help on using the changeset viewer.