From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from m16.mail.126.com (m16.mail.126.com [117.135.210.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB17B3939BD for ; Mon, 13 Jul 2026 07:46:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783928811; cv=none; b=orBs07zPHFNFzZ62Go3VnLhocmbJpKMYOLTLNaSm5QTiQta5MmN9r/rMxrzOl5nqQx/Rn9dyg3/0/WcjYIi1T1lsFe81ZOXQPe+CuiI7yC/fyrXZ5ZHiPEDI0wRoIiJVns96LVTxOo2b6YPYVmolsjdeVWhyOKXsTsH5B7fbz2I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783928811; c=relaxed/simple; bh=nbMcjWH8rnsFeIepuaXcsYFlJa0JG89BQzvjdlEbk88=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=Cs+YzJxpfI23xoU1NZ4TKwYt6+zGuwdD5rFYpUoDAPkng/ghYKSPT1v+TsOyl2ylq7jBStEbU8Mbs8k4GrCq8GopVZ0ao4+vfAKFegT/igFsoHKoDuh75tH53g531n6o5INAp7PKta+saiP5k5agomAbi+E1EvVD3gs3idrx+oU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com; spf=pass smtp.mailfrom=126.com; dkim=pass (1024-bit key) header.d=126.com header.i=@126.com header.b=LcD0keLc; arc=none smtp.client-ip=117.135.210.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=126.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=126.com header.i=@126.com header.b="LcD0keLc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=Message-ID:Date:From:MIME-Version:To:Subject: Content-Type; bh=Sd5LcECOeYnW6IdQZhIytTV2jUItt7eRmsgeJq00wgE=; b=LcD0keLcGkuCSFSKkSe3S1DyFD1kPhyiC5M4UhRSw+F4FPpMtLyavUp5smoNu2 EgPeY45mzfyUKA3u1KEdR8WySIsx/ueBAQEjaXBdlCCN/V9xeUDDKPvi7C59arDD 3AfnMa3gSZi88Eav3uWbqQpRGm8l7QEO+AyA/zMWy8nlY= Received: from localhost.localdomain (unknown []) by gzsmtp1 (Coremail) with SMTP id PCkvCgDnz3+il1RqPwBgCA--.6711S2; Mon, 13 Jul 2026 15:45:39 +0800 (CST) Message-ID: <6A549790.3000203@126.com> Date: Mon, 13 Jul 2026 15:45:20 +0800 From: Hongling Zeng User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: Harry Yoo , Hongling Zeng , vbabka@kernel.org, akpm@linux-foundation.org, hao.li@linux.dev, cl@gentwo.org, rientjes@google.com, roman.gushchin@linux.dev, vdavydov.dev@gmail.com, davej@fedoraproject.org CC: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] mm/slub: add comment explaining intentional kobject handling in sysfs_slab_add References: <20260713070024.153552-1-zenghongling@kylinos.cn> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID:PCkvCgDnz3+il1RqPwBgCA--.6711S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7Ww43CF4UAr4fKr4rZFWkWFg_yoW8XrWfpr 1xJa1UGFW8Cr4xGwsIya48W3s3uas3KF45Gr4Fgw4Yvr1fCr18tF4F9Fy7Za9YkF4xGa1F vF40yw1agryY9F7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07j4Hq7UUUUU= X-CM-SenderInfo: x2kr0wpolqwiqxrzqiyswou0bp/xtbBoAO9jmpUl6OTDAAA3F 在 2026年07月13日 15:26, Harry Yoo 写道: > On 7/13/26 4:00 PM, Hongling Zeng wrote: >> Add a comment to clarify why we don't call kobject_put() when >> kobject_init_and_add() fails in sysfs_slab_add(). >> >> Per commit 2420baa8e046 ("mm/slab: Allow cache creation to proceed >> even if sysfs registration fails"), sysfs failures are treated as >> non-fatal and the cache continues to be used. Calling kobject_put() >> would trigger slab_kmem_cache_release() which frees the entire >> cache structure, so we intentionally skip it. >> >> Suggested-by: Harry Yoo >> Signed-off-by: Hongling Zeng >> --- >> >> Change in v1: >> -Correct the email > Hmm, the email "Hyeonggon Kim " came out of > nowhere. Could you please explain why this happened? My apologies for the confusion. I incorrectly retrieved your email from a signature search :) >> --- >> mm/slub.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/mm/slub.c b/mm/slub.c >> index 9ec774dc7009..edc822d7d9ea 100644 >> --- a/mm/slub.c >> +++ b/mm/slub.c >> @@ -9690,6 +9690,11 @@ static int sysfs_slab_add(struct kmem_cache *s) >> >> s->kobj.kset = kset; >> err = kobject_init_and_add(&s->kobj, &slab_ktype, NULL, "%s", name); >> + /* >> + * Intentionally skip kobject_put(). See commit 2420baa8e046 >> + * ("mm/slab: Allow cache creation to proceed even if sysfs >> + * registration fails") >> + */ >> if (err) >> goto out;