lkml.org 
[lkml]   [2022]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2 10/23] mm/slab_common: cleanup kmem_cache_alloc{,node,lru}
    On 4/14/22 10:57, Hyeonggon Yoo wrote:
    > Implement only __kmem_cache_alloc_node() in slab allocators and make
    > kmem_cache_alloc{,node,lru} wrapper of it.
    >
    > Now that kmem_cache_alloc{,node,lru} is inline function, we should
    > use _THIS_IP_ instead of _RET_IP_ for consistency.

    Hm yeah looks like this actually fixes some damage of obscured actual
    __RET_IP_ by the recent addition and wrapping of __kmem_cache_alloc_lru().

    > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>

    Reviewed-by: Vlastimil Babka <vbabka@suse.cz>

    Some nits:

    > ---
    > include/linux/slab.h | 52 ++++++++++++++++++++++++++++++++-----
    > mm/slab.c | 61 +++++---------------------------------------
    > mm/slob.c | 27 ++++++--------------
    > mm/slub.c | 35 +++++--------------------
    > 4 files changed, 67 insertions(+), 108 deletions(-)
    >
    > diff --git a/include/linux/slab.h b/include/linux/slab.h
    > index 143830f57a7f..1b5bdcb0fd31 100644
    > --- a/include/linux/slab.h
    > +++ b/include/linux/slab.h
    > @@ -429,9 +429,52 @@ void *__kmalloc(size_t size, gfp_t flags)
    > return __kmalloc_node(size, flags, NUMA_NO_NODE);
    > }
    >
    > -void *kmem_cache_alloc(struct kmem_cache *s, gfp_t flags) __assume_slab_alignment __malloc;
    > -void *kmem_cache_alloc_lru(struct kmem_cache *s, struct list_lru *lru,
    > - gfp_t gfpflags) __assume_slab_alignment __malloc;
    > +
    > +void *__kmem_cache_alloc_node(struct kmem_cache *s, struct list_lru *lru,
    > + gfp_t gfpflags, int node, unsigned long caller __maybe_unused)
    > + __assume_slab_alignment __malloc;

    I don't think caller needs to be __maybe_unused in the declaration nor any
    of the implementations of __kmem_cache_alloc_node(), all actually pass it on?

    \
     
     \ /
      Last update: 2022-04-26 20:03    [W:4.140 / U:0.048 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site