lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 30 Apr 2022 11:48:56 +0000
From:   Hyeonggon Yoo <42.hyeyoo@...il.com>
To:     Vlastimil Babka <vbabka@...e.cz>
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 10/23] mm/slab_common: cleanup
 kmem_cache_alloc{,node,lru}

On Tue, Apr 26, 2022 at 08:01:27PM +0200, Vlastimil Babka wrote:
> 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@...il.com>
> 
> Reviewed-by: Vlastimil Babka <vbabka@...e.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?

My intention was to give hints to compilers when CONFIG_TRACING=n.
I'll check if the compiler just optimizes them without __maybe_unused.

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ