Changeset bd48f4c in mainline for kernel/generic/src/mm/slab.c


Ignore:
Timestamp:
2010-07-12T10:53:30Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bd11d3e
Parents:
c40e6ef (diff), bee2d4c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    rc40e6ef rbd48f4c  
    177177 *
    178178 */
    179 static slab_t *slab_space_alloc(slab_cache_t *cache, unsigned int flags)
     179NO_TRACE static slab_t *slab_space_alloc(slab_cache_t *cache,
     180    unsigned int flags)
    180181{
    181182       
     
    224225 *
    225226 */
    226 static size_t slab_space_free(slab_cache_t *cache, slab_t *slab)
     227NO_TRACE static size_t slab_space_free(slab_cache_t *cache, slab_t *slab)
    227228{
    228229        frame_free(KA2PA(slab->start));
     
    236237
    237238/** Map object to slab structure */
    238 static slab_t *obj2slab(void *obj)
     239NO_TRACE static slab_t *obj2slab(void *obj)
    239240{
    240241        return (slab_t *) frame_get_parent(ADDR2PFN(KA2PA(obj)), 0);
     
    252253 *
    253254 */
    254 static size_t slab_obj_destroy(slab_cache_t *cache, void *obj, slab_t *slab)
     255NO_TRACE static size_t slab_obj_destroy(slab_cache_t *cache, void *obj,
     256    slab_t *slab)
    255257{
    256258        if (!slab)
     
    293295 *
    294296 */
    295 static void *slab_obj_create(slab_cache_t *cache, int flags)
     297NO_TRACE static void *slab_obj_create(slab_cache_t *cache, unsigned int flags)
    296298{
    297299        spinlock_lock(&cache->slablock);
     
    349351 *
    350352 */
    351 static slab_magazine_t *get_mag_from_cache(slab_cache_t *cache, bool first)
     353NO_TRACE static slab_magazine_t *get_mag_from_cache(slab_cache_t *cache,
     354    bool first)
    352355{
    353356        slab_magazine_t *mag = NULL;
     
    373376 *
    374377 */
    375 static void put_mag_to_cache(slab_cache_t *cache, slab_magazine_t *mag)
     378NO_TRACE static void put_mag_to_cache(slab_cache_t *cache,
     379    slab_magazine_t *mag)
    376380{
    377381        spinlock_lock(&cache->maglock);
     
    388392 *
    389393 */
    390 static size_t magazine_destroy(slab_cache_t *cache, slab_magazine_t *mag)
     394NO_TRACE static size_t magazine_destroy(slab_cache_t *cache,
     395    slab_magazine_t *mag)
    391396{
    392397        size_t i;
     
    406411 *
    407412 */
    408 static slab_magazine_t *get_full_current_mag(slab_cache_t *cache)
     413NO_TRACE static slab_magazine_t *get_full_current_mag(slab_cache_t *cache)
    409414{
    410415        slab_magazine_t *cmag = cache->mag_cache[CPU->id].current;
    411416        slab_magazine_t *lastmag = cache->mag_cache[CPU->id].last;
    412 
     417       
    413418        ASSERT(spinlock_locked(&cache->mag_cache[CPU->id].lock));
    414419       
     
    443448 *
    444449 */
    445 static void *magazine_obj_get(slab_cache_t *cache)
     450NO_TRACE static void *magazine_obj_get(slab_cache_t *cache)
    446451{
    447452        if (!CPU)
     
    473478 *
    474479 */
    475 static slab_magazine_t *make_empty_current_mag(slab_cache_t *cache)
     480NO_TRACE static slab_magazine_t *make_empty_current_mag(slab_cache_t *cache)
    476481{
    477482        slab_magazine_t *cmag = cache->mag_cache[CPU->id].current;
     
    479484       
    480485        ASSERT(spinlock_locked(&cache->mag_cache[CPU->id].lock));
    481 
     486       
    482487        if (cmag) {
    483488                if (cmag->busy < cmag->size)
     
    523528 *
    524529 */
    525 static int magazine_obj_put(slab_cache_t *cache, void *obj)
     530NO_TRACE static int magazine_obj_put(slab_cache_t *cache, void *obj)
    526531{
    527532        if (!CPU)
     
    552557 *
    553558 */
    554 static size_t comp_objects(slab_cache_t *cache)
     559NO_TRACE static size_t comp_objects(slab_cache_t *cache)
    555560{
    556561        if (cache->flags & SLAB_CACHE_SLINSIDE)
     
    564569 *
    565570 */
    566 static size_t badness(slab_cache_t *cache)
     571NO_TRACE static size_t badness(slab_cache_t *cache)
    567572{
    568573        size_t objects = comp_objects(cache);
     
    578583 *
    579584 */
    580 static bool make_magcache(slab_cache_t *cache)
     585NO_TRACE static bool make_magcache(slab_cache_t *cache)
    581586{
    582587        ASSERT(_slab_initialized >= 2);
     
    600605 *
    601606 */
    602 static void _slab_cache_create(slab_cache_t *cache, const char *name,
     607NO_TRACE static void _slab_cache_create(slab_cache_t *cache, const char *name,
    603608    size_t size, size_t align, int (*constructor)(void *obj,
    604609    unsigned int kmflag), size_t (*destructor)(void *obj), unsigned int flags)
     
    676681 *
    677682 */
    678 static size_t _slab_reclaim(slab_cache_t *cache, unsigned int flags)
     683NO_TRACE static size_t _slab_reclaim(slab_cache_t *cache, unsigned int flags)
    679684{
    680685        if (cache->flags & SLAB_CACHE_NOMAGAZINE)
     
    781786 *
    782787 */
    783 static void _slab_free(slab_cache_t *cache, void *obj, slab_t *slab)
     788NO_TRACE static void _slab_free(slab_cache_t *cache, void *obj, slab_t *slab)
    784789{
    785790        ipl_t ipl = interrupts_disable();
     
    829834void slab_print_list(void)
    830835{
    831         printf("slab name        size     pages  obj/pg   slabs  cached allocated"
    832             " ctl\n");
    833         printf("---------------- -------- ------ -------- ------ ------ ---------"
    834             " ---\n");
     836        printf("[slab name       ] [size  ] [pages ] [obj/pg] [slabs ]"
     837            " [cached] [alloc ] [ctl]\n");
    835838       
    836839        size_t skip = 0;
     
    887890                irq_spinlock_unlock(&slab_cache_lock, true);
    888891               
    889                 printf("%-16s %8" PRIs " %6u %8" PRIs " %6ld %6ld %9ld %-3s\n",
     892                printf("%-18s %8" PRIs " %8u %8" PRIs " %8ld %8ld %8ld %-5s\n",
    890893                    name, size, (1 << order), objects, allocated_slabs,
    891894                    cached_objs, allocated_objs,
Note: See TracChangeset for help on using the changeset viewer.