mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Zhen Lei <thunder.leizhen@huawei.com>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] mm/slab: remove duplicate check in create_cache()
Date: Wed, 9 Oct 2024 12:59:36 +0200	[thread overview]
Message-ID: <26f13bdf-72fa-4400-84eb-2f876ff1e218@suse.cz> (raw)
In-Reply-To: <20241009035455.616-1-thunder.leizhen@huawei.com>

On 10/9/24 05:54, Zhen Lei wrote:
> The WARN_ON() check in static function create_cache() is done by its only
> parent __kmem_cache_create_args() before calling it.
> 	if (... ||
> 	    WARN_ON(... ||
> 		    object_size - args->usersize < args->useroffset))
> 		args->usersize = args->useroffset = 0;
> 	...
> 	s = create_cache(cache_name, object_size, args, flags);
> 
> Therefore, the WARN_ON() check in create_cache() can be safely removed.
> 
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

Added to slab/for-next, thanks.

> ---
>  mm/slab_common.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> v1 --> v2:
> Updates based on the latest v6.12-rc2.
> 
> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index 3d26c257ed8b57c..88aa64fc8cd2742 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -222,9 +222,6 @@ static struct kmem_cache *create_cache(const char *name,
>  	struct kmem_cache *s;
>  	int err;
>  
> -	if (WARN_ON(args->useroffset + args->usersize > object_size))
> -		args->useroffset = args->usersize = 0;
> -
>  	/* If a custom freelist pointer is requested make sure it's sane. */
>  	err = -EINVAL;
>  	if (args->use_freeptr_offset &&


      reply	other threads:[~2024-10-09 10:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09  3:54 Zhen Lei
2024-10-09 10:59 ` Vlastimil Babka [this message]

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=26f13bdf-72fa-4400-84eb-2f876ff1e218@suse.cz \
    --to=vbabka@suse.cz \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=thunder.leizhen@huawei.com \
    /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

all inboxes | Powered by JetHome®