[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YmKjkU2mFrZsle4M@hyeyoo>
Date: Fri, 22 Apr 2022 21:46:09 +0900
From: Hyeonggon Yoo <42.hyeyoo@...il.com>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: linux-mm@...ck.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>,
Marco Elver <elver@...gle.com>,
Matthew WilCox <willy@...radead.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v1 08/15] mm/sl[auo]b: cleanup kmalloc()
On Thu, Mar 24, 2022 at 06:46:34PM +0100, Vlastimil Babka wrote:
> On 3/8/22 12:41, Hyeonggon Yoo wrote:
> > Now that kmalloc() and kmalloc_node() do same job, make kmalloc()
> > wrapper of kmalloc_node().
> >
> > Remove kmalloc_trace() that is now unused. This patch makes slab
> > allocator use kmalloc_node tracepoints in kmalloc().
> >
> > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@...il.com>
>
> Actually there are more things to fix than the commit log.
>
> > +#ifndef CONFIG_SLOB
> > +static __always_inline __alloc_size(1) void *kmalloc_node(size_t size, gfp_t flags, int node)
> > +{
> > + if (__builtin_constant_p(size)) {
> > + unsigned int index;
> > +
> > + if (size > KMALLOC_MAX_CACHE_SIZE)
> > + return kmalloc_large(size, flags);
>
> Should use kmalloc_large_node().
>
> > +
> > + index = kmalloc_index(size);
> > +
> > + if (!index)
> > + return ZERO_SIZE_PTR;
> > +
> > + return kmem_cache_alloc_node_trace(
> > + kmalloc_caches[kmalloc_type(flags)][index],
> > + flags, node, size);
> > + }
> > + return __kmalloc_node(size, flags, node);
> > +}
> > +#else
> > +static __always_inline __alloc_size(1) void *kmalloc_node(size_t size, gfp_t flags, int node)
> > +{
> > + if (__builtin_constant_p(size) && size > KMALLOC_MAX_CACHE_SIZE)
> > + return kmalloc_large(size, flags);
>
> And here.
>
Sorry for the mistake. did it in v2. thanks!
> > +
> > + return __kmalloc_node(size, flags, node);
> > +}
> > +#endif
--
Thanks,
Hyeonggon
Powered by blists - more mailing lists