[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3a12e66d-58cb-d768-7b2e-4eb239c03ee6@suse.cz>
Date: Fri, 29 Apr 2022 16:30:29 +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 18/23] mm/sl[au]b: generalize kmalloc subsystem
On 4/14/22 10:57, Hyeonggon Yoo wrote:
> Now everything in kmalloc subsystem can be generalized.
> Let's do it!
>
> Generalize __kmalloc_node_track_caller(), kfree(), __ksize(),
> __kmalloc_node() and move them to slab_common.c.
>
> Signed-off-by: Hyeonggon Yoo <42.hyeyoo@...il.com>
> ---
> mm/slab.c | 94 -----------------------------------------------
> mm/slab_common.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++++
> mm/slub.c | 88 --------------------------------------------
> 3 files changed, 95 insertions(+), 182 deletions(-)
>
> diff --git a/mm/slab.c b/mm/slab.c
> index d35873da5572..fc00aca62ae3 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -3527,36 +3527,6 @@ void *kmem_cache_alloc_node_trace(struct kmem_cache *cachep,
> EXPORT_SYMBOL(kmem_cache_alloc_node_trace);
> #endif
>
> -static __always_inline void *
> -__do_kmalloc_node(size_t size, gfp_t flags, int node, unsigned long caller)
> -{
> - struct kmem_cache *cachep;
> - void *ret;
> -
> - if (unlikely(size > KMALLOC_MAX_CACHE_SIZE))
> - return kmalloc_large_node(size, flags, node);
> - cachep = kmalloc_slab(size, flags);
> - if (unlikely(ZERO_OR_NULL_PTR(cachep)))
> - return cachep;
> - ret = kmem_cache_alloc_node_trace(cachep, flags, node, size);
> - ret = kasan_kmalloc(cachep, ret, size, flags);
SLAB did kasan_kmalloc() when called from __kmalloc_node_track_caller(), and
will not do after this patch, until the next patch 19/23. So I would just
fold it to this patch.
> -
> - return ret;
> -}
> -
> -void *__kmalloc_node(size_t size, gfp_t flags, int node)
> -{
> - return __do_kmalloc_node(size, flags, node, _RET_IP_);
> -}
> -EXPORT_SYMBOL(__kmalloc_node);
> -
> -void *__kmalloc_node_track_caller(size_t size, gfp_t flags,
> - int node, unsigned long caller)
> -{
> - return __do_kmalloc_node(size, flags, node, caller);
> -}
> -EXPORT_SYMBOL(__kmalloc_node_track_caller);
> -
> #ifdef CONFIG_PRINTK
> void kmem_obj_info(struct kmem_obj_info *kpp, void *object, struct slab *slab)
> {
Powered by blists - more mailing lists