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 06C94372EF0 for ; Wed, 22 Jul 2026 07:08:17 +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=1784704098; cv=none; b=eIO2yGas93BdYPGdqgfFpbEqY0PDxDd20lj8qWwAPwGSQ1uHnM11qrhxqIQdEGpg2OY/v++Hlbu4Rz44IVRczG3hKNh0Wpod5/l/BnQa6EqhrU73tKXJ9nJNJ249QFXLioyUZmtLH1poJKwTNqTa1VemRKkHOtXPhyOxFe3AtgM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784704098; c=relaxed/simple; bh=kvPCaQNwP4e2MplMO9N+xeIvanft790VdkTHM9ezQHc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SODgl/3/fUTRi3lhkS2nFYEc80xI7Lf5UlQpF7lW/kIQbCBdlNzcypwXnF1+juPLi3mOcyHft0ibRFM8LOoLxJJPWJa15RtIurAuOvFYyJLDU5Uk1R22D7F9/96kNS8WCgf6I5y5UIr4CKICeGp4Wb5B6lMcK8qrSguERTTSVMQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=D5aVet97; 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="D5aVet97" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DE8E1F000E9; Wed, 22 Jul 2026 07:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784704096; bh=ffKA3v8JXhual6MJp3NZTppdmwPwKkpdeSEyJ3K/MqY=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=D5aVet97eXazbrvprI2QQmqdPDlsIBtvqVq0N6A1dpIb8YhN2eOilNC+OGsrtITZm u9b4iw2oqG63lnSGswUs3R2WWxRH12rKCRJlT1GmDBnJt4pGOqgaERfXMuSa7rBwwW OCVBWnGpGb64cxIJ73biwK/EJk+4J1ZABtj/39sonprHRn7hEqdpUyJ2KbtE0jHvin y1CTrk5SQ8BSCYxN6Rsrj4uKSwweCGRwaViCMCvqaij1zfSsD1P9l4ISlGHhvKcIgm zdpCvelViIEAz2tBMKXwlKPR6moduVJN+lNvB67DsN9nd9ONljbek1a1qnvgRuRiFF S/PIXA0YHvDkw== Message-ID: <9e65f398-5576-48df-85fa-3d993b9e163b@kernel.org> Date: Wed, 22 Jul 2026 16:08:06 +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] slab: silence sparse warning with type-based partitioning To: Marco Elver , Vlastimil Babka , Andrew Morton Cc: Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, kernel test robot References: <20260721092005.1986693-1-elver@google.com> Content-Language: en-US From: Harry Yoo In-Reply-To: <20260721092005.1986693-1-elver@google.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------6m9D5WkPAdlH0TQWgJq33p0J" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------6m9D5WkPAdlH0TQWgJq33p0J Content-Type: multipart/mixed; boundary="------------w3q0NO5NRlwkt4rlkq1vNAGu"; protected-headers="v1" From: Harry Yoo To: Marco Elver , Vlastimil Babka , Andrew Morton Cc: Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, kernel test robot Message-ID: <9e65f398-5576-48df-85fa-3d993b9e163b@kernel.org> Subject: Re: [PATCH] slab: silence sparse warning with type-based partitioning References: <20260721092005.1986693-1-elver@google.com> In-Reply-To: <20260721092005.1986693-1-elver@google.com> --------------w3q0NO5NRlwkt4rlkq1vNAGu Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 7/21/26 6:19 PM, Marco Elver wrote: > Sparse does not know __builtin_infer_alloc_token() and complains: >=20 > sparse: sparse: undefined identifier '__builtin_infer_alloc_token' >=20 > Fix it by using a dummy variant of __kmalloc_token() if __CHECKER__ is > defined. >=20 > Fixes: feb662d9168b ("slab: support for compiler-assisted type-based sl= ab cache partitioning") > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-kbuild-all/202607110912.nZTqfCrH-lkp= @intel.com/ > Signed-off-by: Marco Elver > --- FWIW, Acked-by: Harry Yoo (Oracle) > include/linux/slab.h | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/include/linux/slab.h b/include/linux/slab.h > index 51f03f18c9a7..7ffe152ce483 100644 > --- a/include/linux/slab.h > +++ b/include/linux/slab.h > @@ -505,8 +505,12 @@ typedef struct { unsigned long v; } kmalloc_token_= t; > extern unsigned long random_kmalloc_seed; > #define __kmalloc_token(...) ((kmalloc_token_t){ .v =3D _CODE_LOCATION= _ }) > #elif defined(CONFIG_KMALLOC_PARTITION_TYPED) > +#ifdef __CHECKER__ > +#define __kmalloc_token(...) ((kmalloc_token_t){ .v =3D 0 }) > +#else /* !__CHECKER__ */ > #define __kmalloc_token(...) ((kmalloc_token_t){ .v =3D __builtin_infe= r_alloc_token(__VA_ARGS__) }) > -#endif > +#endif /* __CHECKER__ */ > +#endif /* CONFIG_KMALLOC_PARTITION_TYPED */ > #define DECL_TOKEN_PARAM(_token) , kmalloc_token_t (_token) > #define _PASS_TOKEN_PARAM(_token) , (_token) > #define PASS_TOKEN_PARAM(_token) (_token) --=20 Cheers, Harry / Hyeonggon --------------w3q0NO5NRlwkt4rlkq1vNAGu-- --------------6m9D5WkPAdlH0TQWgJq33p0J Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQQ1ub6gR5ogjaKRmOGXBN6rc5S1gUCamBsVgAKCRCGXBN6rc5S 1l5EAP9V49DkdzS2HLB3lWDL05UG0KOMuz2kHVDNeGNzlpHfmAD/T5fLEfNPnmVy eAlw6dbWs92E1AhoN5NmO3k3+D8i0wE= =/o29 -----END PGP SIGNATURE----- --------------6m9D5WkPAdlH0TQWgJq33p0J--