From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4565836D9E0 for ; Mon, 13 Jul 2026 07:27:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783927635; cv=none; b=Zj2Rl6ENid7+aZE0l2tqto7ipV8hH2isVp89ffolxjlHG6WYRltwgl1kPN6pTLvlLlMEpG/vLqJbVny+mumHRaZlGYG4A2YuHzEjpTFdLpnUE7EzeQxx4UJyEkV/VfdT2s+yM2yomE8AWAeGT4SlKWDCP8lA0gJnfgy2bl8t9HA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783927635; c=relaxed/simple; bh=p0LBMnI+uHQ7hSpadepSx1vM+x6JZITpWg/GVv9wym0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MUFpHMHV2+RXJoy6+AbNRsNdcXCKtREPQGuDHN2rOj7YQSuh7AZybcAxbVLtGVfq+ZEDyeutmUKC8KAfCTUPUgAotA52aMk3VUDV/IQbdCG/ysbkAczj1qhx7NHV/fVy0M2OD8owZb5vR93iHV8e/vtSL260lwXbD5SBeak8BIg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YwHY8qWz; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YwHY8qWz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F7181F00A3A; Mon, 13 Jul 2026 07:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783927634; bh=WYKnFncXJeNp/IdRDclihrL+DXMOIxQ7CXyCofknvSo=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=YwHY8qWzcHzCGZtk7Sq1PHRZM8J54wVcrklJxUjnW6z/R0l+/Ly7ytc2FjLVn8inN xLES1BH/9GlpMKPrOyGBQLHWKERAob5SNrrQi9bygTXT0cyQCiWVDhPX1L0m0tf8+S DLuzDz/BxqEpjdYK5flQaeIwR3aPkGFWfyzYHzrZPSKZqu0SMF8tjvTD+6XqMOdygR cAMZILQEE7HvWoky6cRfF5ea38Ue4FgFoXps/PplqBFzyTZSjP4p5gf1roIiKizcWZ kXzdbADNw3C8ToInhKm1qo9BTuiiW88+dslKPVvIDenqLve0ht1cxlD3DCVTnjzFHy LrwaCncaSecIQ== Message-ID: Date: Mon, 13 Jul 2026 16:26:59 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] mm/slub: add comment explaining intentional kobject handling in sysfs_slab_add To: 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, zhongling0719@126.com References: <20260713070024.153552-1-zenghongling@kylinos.cn> Content-Language: en-US From: Harry Yoo In-Reply-To: <20260713070024.153552-1-zenghongling@kylinos.cn> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------qZrq4l3fGXVVi20MOTQhs4B3" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------qZrq4l3fGXVVi20MOTQhs4B3 Content-Type: multipart/mixed; boundary="------------jL0A6RCvBI6v0ppT4j3zvBOH"; protected-headers="v1" From: Harry Yoo To: 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, zhongling0719@126.com Message-ID: 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: <20260713070024.153552-1-zenghongling@kylinos.cn> --------------jL0A6RCvBI6v0ppT4j3zvBOH Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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(). >=20 > 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. >=20 > 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? > --- > mm/slub.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > 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) > =20 > s->kobj.kset =3D kset; > err =3D 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; --=20 Cheers, Harry / Hyeonggon --------------jL0A6RCvBI6v0ppT4j3zvBOH-- --------------qZrq4l3fGXVVi20MOTQhs4B3 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQQ1ub6gR5ogjaKRmOGXBN6rc5S1gUCalSTRAAKCRCGXBN6rc5S 1njlAP4/rveoSWCzl1am752qZkVqCy+RNsMkCmfloYCKUC7zrAEAyXCnugkZftyJ uzJYGd/4ZzKqEnO2uI/+RYt2NctePgE= =qqg4 -----END PGP SIGNATURE----- --------------qZrq4l3fGXVVi20MOTQhs4B3--