Changeset e22f561 in mainline


Ignore:
Timestamp:
2006-02-05T12:29:57Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
248fc1a
Parents:
5158549
Message:

Small locking performance tweak.

File:
1 edited

Legend:

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

    r5158549 re22f561  
    229229                                slab_t *slab)
    230230{
    231         count_t frames = 0;
    232 
    233231        if (!slab)
    234232                slab = obj2slab(obj);
     
    247245                /* Free associated memory */
    248246                list_remove(&slab->link);
    249                 /* This should not produce deadlock, as
    250                  * magazine is always allocated with NO reclaim,
    251                  * keep all locks */
    252                 frames = slab_space_free(cache, slab);
     247                spinlock_unlock(&cache->slablock);
     248
     249                return slab_space_free(cache, slab);
     250
    253251        } else if (slab->available == 1) {
    254252                /* It was in full, move to partial */
    255253                list_remove(&slab->link);
    256254                list_prepend(&slab->link, &cache->partial_slabs);
    257         }
    258 
    259         spinlock_unlock(&cache->slablock);
    260 
    261         return frames;
     255                spinlock_unlock(&cache->slablock);
     256        }
     257        return 0;
    262258}
    263259
     
    745741        /* TODO: Add assert, that interrupts are disabled, otherwise
    746742         * memory allocation from interrupts can deadlock.
    747          * - cache_destroy can call this with interrupts enabled :-/
    748743         */
    749744
Note: See TracChangeset for help on using the changeset viewer.