From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8580B1F151C; Fri, 3 Apr 2026 18:29:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775240971; cv=none; b=S4pxv01mxf322x+J7PRbs1u5TeE48cDW0UXlSG1xxpO8EoDbNqLxN2N2f8UoAC99IN2g6GjaqktXPLQu/gTmjXiY3ZXvLpT8hmhSGAtWwSEKMkFTQzA8u0snVP6a+HldB6nakPAajNAUkWADU+1NDURqIkcPqMGHNP4d3PdDw8c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775240971; c=relaxed/simple; bh=2LaCesgEqKearbmEy0CIdH1OxXGy3hFRgnwk7wdkISs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AeEKAZycWT1fYhdm2ApqiXRlS+qq4RbNrtkGWcwi0+f04oNkUtZOSr/MlrnwPZxiyau+O+GrGVoIj6sB80lgpcBofrkPCH2hFF4yzCYY0NF1sAHduvEcTjNLZrRBQ4n8pDF6LE1fGYELHhhbMUMDzkN+KtjkgW44F0OHuk16PWI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JFfoe+Od; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JFfoe+Od" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7854CC4CEF7; Fri, 3 Apr 2026 18:29:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775240971; bh=2LaCesgEqKearbmEy0CIdH1OxXGy3hFRgnwk7wdkISs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=JFfoe+OdYtwOwBNifEpqm7IRcYHNx8GK/H/UXt4zENrJ40+pbi/suVM7tB5nwYUoz 43CneCDysSjvSJwT+97osxUozGqQ+k5rrR2f4w2qfF4s2/ynhOqo4sYElxPb4UicWQ Cxamq9EAHCCoyEZydeL5mxRYYT6UjLxLmnLPyHwfsKR1qDviIVBuTYbLnjyXeef3pv eOVagQAWx/m+AoA6Y8ONDtRjXtl8nMq62cTqwkYwaJAFUYDxK/FKCjy+W25DGNIwUH s+We36PVVj6YWendwlyyYb0TQpiVfCOj+MvYwC5WWcCxerl2j/g3bwHB3jnNoFPC/W fYMAxj+aKPE2A== Message-ID: Date: Fri, 3 Apr 2026 20:29:22 +0200 Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] slab: support for compiler-assisted type-based slab cache partitioning Content-Language: en-US To: "Harry Yoo (Oracle)" , Marco Elver Cc: Andrew Morton , Nathan Chancellor , Nicolas Schier , Dennis Zhou , Tejun Heo , Christoph Lameter , Hao Li , David Rientjes , Roman Gushchin , Kees Cook , "Gustavo A. R. Silva" , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Alexander Potapenko , Dmitry Vyukov , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org, kasan-dev@googlegroups.com, llvm@lists.linux.dev, Andrey Konovalov , Florent Revest , GONG Ruiqi , Jann Horn , KP Singh , Matteo Rizzo References: <20260331111240.153913-1-elver@google.com> From: "Vlastimil Babka (SUSE)" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/3/26 08:27, Harry Yoo (Oracle) wrote: >> diff --git a/include/linux/slab.h b/include/linux/slab.h >> index 15a60b501b95..c0bf00ee6025 100644 >> --- a/include/linux/slab.h >> +++ b/include/linux/slab.h >> @@ -864,10 +877,10 @@ unsigned int kmem_cache_sheaf_size(struct slab_sheaf *sheaf); >> * with the exception of kunit tests >> */ >> >> -void *__kmalloc_noprof(size_t size, gfp_t flags) >> +void *__kmalloc_noprof(size_t size, gfp_t flags, kmalloc_token_t token) >> __assume_kmalloc_alignment __alloc_size(1); >> >> -void *__kmalloc_node_noprof(DECL_BUCKET_PARAMS(size, b), gfp_t flags, int node) >> +void *__kmalloc_node_noprof(DECL_BUCKET_PARAMS(size, b), gfp_t flags, int node, kmalloc_token_t token) >> __assume_kmalloc_alignment __alloc_size(1); > > So the @token parameter is unused when CONFIG_PARTITION_KMALLOC_CACHES is > disabled but still increases the kernel size by a few kilobytes... > but yeah I'm not sure if we can get avoid it without hurting readability. > > Just saying. (does anybody care?) Well we did care enough with CONFIG_SLAB_BUCKETS to hide the unused param using DECL_BUCKET_PARAMS(), so maybe extend that idea? I think it's not just kernel size, but increased register pressure etc.