[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <768d4216-232e-6c67-b395-83c2f34c7970@suse.cz>
Date: Tue, 26 Apr 2022 18:02:18 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Hyeonggon Yoo <42.hyeyoo@...il.com>
Cc: Marco Elver <elver@...gle.com>,
Matthew WilCox <willy@...radead.org>,
Christoph Lameter <cl@...ux.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Roman Gushchin <roman.gushchin@...ux.dev>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 05/23] mm/slab_common: cleanup __kmalloc()
On 4/14/22 10:57, Hyeonggon Yoo wrote:
> Make __kmalloc() wrapper of __kmalloc_node().
Again/similarly, looks like this will make SLUB not miss trace for
kmalloc_large() anymore.
> Signed-off-by: Hyeonggon Yoo <42.hyeyoo@...il.com>
Reviewed-by: Vlastimil Babka <vbabka@...e.cz>
Nit below:
> ---
> include/linux/slab.h | 13 ++++++++++---
> mm/slab.c | 34 ----------------------------------
> mm/slob.c | 6 ------
> mm/slub.c | 23 -----------------------
> 4 files changed, 10 insertions(+), 66 deletions(-)
>
> diff --git a/include/linux/slab.h b/include/linux/slab.h
> index acdb4b7428f9..4c06d15f731c 100644
> --- a/include/linux/slab.h
> +++ b/include/linux/slab.h
> @@ -419,7 +419,16 @@ static __always_inline unsigned int __kmalloc_index(size_t size,
> #define kmalloc_index(s) __kmalloc_index(s, true)
> #endif /* !CONFIG_SLOB */
>
> -void *__kmalloc(size_t size, gfp_t flags) __assume_kmalloc_alignment __alloc_size(1);
> +extern void *__kmalloc_node(size_t size, gfp_t flags, int node)
> + __assume_kmalloc_alignment
> + __alloc_size(1);
> +
Again, no 'extern' please.
> +static __always_inline __alloc_size(1) __assume_kmalloc_alignment
> +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;
Powered by blists - more mailing lists