lkml.org 
[lkml]   [2012]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/4] slub: change declare of get_slab() to inline at all times
    Date
    __kmalloc and it's variants are invoked much frequently
    and these are performance critical functions,
    so their callee functions are declared '__always_inline'
    But, currently, get_slab() isn't declared '__always_inline'.
    In result, __kmalloc and it's variants call get_slab() on x86.
    It is not desirable result, so change it to inline at all times.

    Signed-off-by: Joonsoo Kim <js1304@gmail.com>

    diff --git a/mm/slub.c b/mm/slub.c
    index 71de9b5..30ceb6d 100644
    --- a/mm/slub.c
    +++ b/mm/slub.c
    @@ -3320,7 +3320,7 @@ static inline int size_index_elem(size_t bytes)
    return (bytes - 1) / 8;
    }

    -static struct kmem_cache *get_slab(size_t size, gfp_t flags)
    +static __always_inline struct kmem_cache *get_slab(size_t size, gfp_t flags)
    {
    int index;

    --
    1.7.9.5


    \
     
     \ /
      Last update: 2012-06-08 20:01    [W:0.023 / U:58.864 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site