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]
Message-ID: <228411f0-96b9-60b4-b734-444ea39a354b@suse.cz>
Date:   Tue, 26 Apr 2022 20:01:27 +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 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@...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?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ