linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Sangyun Kim <sangyun.kim@snu.ac.kr>
Cc: linux-mm@kvack.org, Christoph Lameter <cl@linux.com>,
	 Pekka Enberg <penberg@kernel.org>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	 Vlastimil Babka <vbabka@suse.cz>,
	 Roman Gushchin <roman.gushchin@linux.dev>,
	 Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Hyunmin Lee <hyunminlr@gmail.com>,
	 Jeungwoo Yoo <casionwoo@gmail.com>,
	 Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Subject: Re: [PATCH] mm/slub: remove duplicate initialization for early_kmem_cache_node_alloc()
Date: Sun, 7 Apr 2024 14:06:19 -0700 (PDT)	[thread overview]
Message-ID: <5bfe9c1c-7620-b7fd-b5fb-c481e7dfa5e7@google.com> (raw)
In-Reply-To: <20240406074449.563704-1-sangyun.kim@snu.ac.kr>

On Sat, 6 Apr 2024, Sangyun Kim wrote:

> The struct track for every object in a new slab is already set up by
> new_slab(),
> so remove the duplicate initialization in early_kmem_cache_node_alloc().
> 
> Signed-off-by: Sangyun Kim <sangyun.kim@snu.ac.kr>
> 
> Co-developed-by: Hyunmin Lee <hyunminlr@gmail.com>
> Signed-off-by: Hyunmin Lee <hyunminlr@gmail.com>
> 
> Co-developed-by: Jeungwoo Yoo <casionwoo@gmail.com>
> Signed-off-by: Jeungwoo Yoo <casionwoo@gmail.com>
> 
> Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> ---
>  mm/slub.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index 0dfc0c18a78b..5ffe46843b36 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -4938,7 +4938,6 @@ static void early_kmem_cache_node_alloc(int node)
>  	BUG_ON(!n);
>  #ifdef CONFIG_SLUB_DEBUG
>  	init_object(kmem_cache_node, n, SLUB_RED_ACTIVE);
> -	init_tracking(kmem_cache_node, n);
>  #endif
>  	n = kasan_slab_alloc(kmem_cache_node, n, GFP_KERNEL, false);
>  	slab->freelist = get_freepointer(kmem_cache_node, n);

I think this is technically safe based on the current implementation 
because, as you said, allocate_slab() takes care of this for 
SLAB_STORE_USER.

What user observable effect does this have given it would only make a 
difference when slab_state == DOWN?


  reply	other threads:[~2024-04-07 21:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-06  7:44 Sangyun Kim
2024-04-07 21:06 ` David Rientjes [this message]
2024-04-08 17:14   ` Christoph Lameter (Ampere)
2024-04-09  3:51     ` 김상윤
2024-04-09  9:43     ` Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5bfe9c1c-7620-b7fd-b5fb-c481e7dfa5e7@google.com \
    --to=rientjes@google.com \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=casionwoo@gmail.com \
    --cc=cl@linux.com \
    --cc=gwan-gyeong.mun@intel.com \
    --cc=hyunminlr@gmail.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=roman.gushchin@linux.dev \
    --cc=sangyun.kim@snu.ac.kr \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox