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 E164C4C92 for ; Wed, 4 Mar 2026 12:30: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=1772627432; cv=none; b=TCv01O5GfOGKhqAjVM9Z7+GuyA9lk68v5hqkxa5fpbVUzHArKw1eBSZyPzKr666J8K2PjxUpF5Z8n2Gb2ptFCmGiGo9PCdhUC/+pvcXJh0AVYwy/VYb6+s0MttkrdA+wrNm0CpEdXYVk+hx6bhetQDi5/+/UKSQnojz/gnbqH+U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772627432; c=relaxed/simple; bh=MsZhn9HPj8dfixAC6alNeGFOzSftdMRsHBiHTVnEr/M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Io9OxopeUXgdYe7+u04rbmw3NhtDkkbnH2PUaJnqNQXJwL8VOAtbVsNJjp0hl9mfSiPNPaijq8EfpIYYZDtM+Go0FFSMw+mwEJ8VtRAmvgDbZWm3G1n1hiOB7LI3OPVkLwdva/3hYdLreCCmUQeis94FWglTBbgJpTKgbsX24m0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Q9Yq1O9e; 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="Q9Yq1O9e" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D165CC19423; Wed, 4 Mar 2026 12:30:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772627431; bh=MsZhn9HPj8dfixAC6alNeGFOzSftdMRsHBiHTVnEr/M=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Q9Yq1O9epDse15BKgVQ1oP95tLsSV0203ET9FjY4xDnn7znAoOEzYrx/rFx3L9ujI 1tXkZiHZpKA5niRStB1UxeEihRMVzsoOon4lw3deyuKTiOaQAeRkgeJg6LohlSCJ+4 PkQ1tz44Wf370hjVll/7Bqyou+Qcfn92vepVHLVahnv3r8hPngz4dUjSeAIEw3ccyL djL6SaSusjodls/fR3KeatoXh3WqNePElLm7azVvODz953ugE8iiHvRbSGXR0rNkmV QNhntKEQTraNsgXNJ+1Ej4D76N3MuTMKjg4Tprot8mv+1WYbbS7/zuEY8tkX2idGTC 9MejedcLxtD2g== Message-ID: Date: Wed, 4 Mar 2026 13:30:27 +0100 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: Update stale comment for sheaf_capacity. To: Kuniyuki Iwashima , Andrew Morton Cc: Christoph Lameter , David Rientjes , Roman Gushchin , Harry Yoo , Kuniyuki Iwashima , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hao Li References: <20260228201510.973702-1-kuniyu@google.com> From: "Vlastimil Babka (SUSE)" Content-Language: en-US In-Reply-To: <20260228201510.973702-1-kuniyu@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/28/26 9:15 PM, Kuniyuki Iwashima wrote: > The comment for sheaf_capacity says it does not enforce NUMA > placement, but it's not true since commit 4ec1a08d2031 ("slab: > allow NUMA restricted allocations to use percpu sheaves"). > > Let's update the comment. > > Signed-off-by: Kuniyuki Iwashima Hm the comment is now more stale than the NUMA aspect. With 7.0-rc1 sheaves exist for all (non-debug) caches. We probably don't need to explain the implementation details there anymore. That includes the NUMA aspect as well. The sheaf_capacity argument can partially override (make it larger, but not smaller) the automatic sheaf size calculation. Would you like to rewrite the comment as per above then? Thanks, Vlastimil > --- > include/linux/slab.h | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/include/linux/slab.h b/include/linux/slab.h > index 15a60b501b95..7477109eb315 100644 > --- a/include/linux/slab.h > +++ b/include/linux/slab.h > @@ -359,9 +359,8 @@ struct kmem_cache_args { > * may replace it with an empty sheaf, unless it's over capacity. In > * that case a sheaf is bulk freed to slab pages. > * > - * The sheaves do not enforce NUMA placement of objects, so allocations > - * via kmem_cache_alloc_node() with a node specified other than > - * NUMA_NO_NODE will bypass them. > + * The sheaves try to enforce NUMA placement of objects, but the > + * allocation may fall back to the normal operation. > * > * Bulk allocation and free operations also try to use the cpu sheaves > * and barn, but fallback to using slab pages directly.