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 1/1] mm/slab: remove duplicate check in create_cache()
Date: Wed, 2 Oct 2024 14:09:30 +0200 [thread overview]
Message-ID: <4dadf9be-a349-4a19-ae9c-652ade9e2198@suse.cz> (raw)
In-Reply-To: <20240821032637.1930-1-thunder.leizhen@huawei.com>
On 8/21/24 05:26, Zhen Lei wrote:
> The WARN_ON() check in static function create_cache() is done by its only
> parent kmem_cache_create_usercopy() before calling it.
> if (...
> WARN_ON(size < usersize || size - usersize < useroffset))
> usersize = useroffset = 0;
> ...
> s = create_cache(..., size, ..., useroffset, usersize, ...);
>
> Therefore, the WARN_ON() check in create_cache() can be safely removed.
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Hi, sorry for the late reply.
This code was heavily refactored as of 6.12-rc1. Can you check if it's still
the case and send updated patch?
Thanks,
Vlastimil
> ---
> mm/slab_common.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index 40b582a014b8f2f..3069c9095523484 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -210,9 +210,6 @@ static struct kmem_cache *create_cache(const char *name,
> struct kmem_cache *s;
> int err;
>
> - if (WARN_ON(useroffset + usersize > object_size))
> - useroffset = usersize = 0;
> -
> err = -ENOMEM;
> s = kmem_cache_zalloc(kmem_cache, GFP_KERNEL);
> if (!s)
next prev parent reply other threads:[~2024-10-02 12:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 3:26 Zhen Lei
2024-10-02 12:09 ` Vlastimil Babka [this message]
2024-10-08 3:29 ` Leizhen (ThunderTown)
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=4dadf9be-a349-4a19-ae9c-652ade9e2198@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