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 E671F396D0D for ; Mon, 16 Mar 2026 13:19:20 +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=1773667161; cv=none; b=FDiZqN0w2pjnaMyjpy7VrdupoTF5t9dcM+CGEPSHaIZoWxKO4Ec/4E1HElVIKN5AaARn3QppD41seN5MOSossIG2ZbofSNNRrUTL6Ah4g5RPEpghOHsfO5BcKtEtjt1OmbVQD4dPKhxWa9iUAyNLS9wdmf1eqa0l42G0O04CIcY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773667161; c=relaxed/simple; bh=+akrXJ7NcRkZB3anvBaBKNDtpqIUvhYi+CUJ5U5SeJo=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=mdQmiWSC8OBIoT3Pc13WQY/eq43TnTwV0VQYF1vErEvS4jUtiJ8bWtOt/vvJ6fk9H+9hhFKj30VIJN6mpZimfxCmVoUz/QDZG19CoSxdx/RUad2M/ECedmGCPqprDFt210eCRnH9b0EHzSeexp/DuAYsTVF3veWyydzJ9FZ/FBo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pIf2SEbz; 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="pIf2SEbz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9CF7C19421; Mon, 16 Mar 2026 13:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773667160; bh=+akrXJ7NcRkZB3anvBaBKNDtpqIUvhYi+CUJ5U5SeJo=; h=Date:From:Subject:To:Cc:References:In-Reply-To:From; b=pIf2SEbz/mNFJt6nVnG6K3cTn1Sgk++2rlTnZfyRU4RFEZoUNcfa1Z9qLoD8up1d0 xn5f3GZUCBv15DrJNsUCU2qJ3Q+kMpsOSM+pv5r0v3IWlraaWTjNKkFb6R1NYwCC+j pH/8t2kt6owcvjD8/ObU5a2+UMOkY4rVcvJRt+XZf3pJ6qVe9xKW1uRbcP3Pz4tNiW 8KecPG3X53ainVtCQUwvF4e1BVWgtSfPb6uRonqDshhsg4jX6prkM37IxP8Wd0WrfJ 5B/tajIcdGQyWsXv8qBqKV79NCLFx86hnS8WiX4SrUgDsfW16ZefwcvjVkpYh3q9sp ahHxHqn8jSu9A== Message-ID: <39cecc4a-608f-4129-a68f-fc23987c8591@kernel.org> Date: Mon, 16 Mar 2026 14:19:16 +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 From: "Vlastimil Babka (SUSE)" Subject: Re: [PATCH 1/3] slab: decouple pointer to barn from kmem_cache_node Content-Language: en-US To: Harry Yoo Cc: Ming Lei , Hao Li , Andrew Morton , Christoph Lameter , David Rientjes , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20260311-b4-slab-memoryless-barns-v1-0-70ab850be4ce@kernel.org> <20260311-b4-slab-memoryless-barns-v1-1-70ab850be4ce@kernel.org> <94d89d84-c009-470e-a401-1ac75228cd92@kernel.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/13/26 12:48, Harry Yoo wrote: > On Fri, Mar 13, 2026 at 10:46:15AM +0100, Vlastimil Babka (SUSE) wrote: >> On 3/13/26 10:27, Harry Yoo wrote: >> > On Wed, Mar 11, 2026 at 09:25:55AM +0100, Vlastimil Babka (SUSE) wrote: >> >> diff --git a/mm/slub.c b/mm/slub.c >> >> index 20cb4f3b636d..609a183f8533 100644 >> >> --- a/mm/slub.c >> >> +++ b/mm/slub.c >> >> @@ -436,26 +436,24 @@ struct kmem_cache_node { >> >> /* >> >> - * Get the barn of the current cpu's closest memory node. It may not exist on >> >> - * systems with memoryless nodes but without CONFIG_HAVE_MEMORYLESS_NODES >> >> + * Get the barn of the current cpu's memory node. It may be a memoryless node. >> >> */ >> >> static inline struct node_barn *get_barn(struct kmem_cache *s) >> >> { >> >> - struct kmem_cache_node *n = get_node(s, numa_mem_id()); >> >> - >> >> - if (!n) >> >> - return NULL; >> >> - >> >> - return n->barn; >> >> + return get_barn_node(s, numa_node_id()); >> >> } >> > >> > Previously, memoryless nodes on architectures w/ CONFIG_HAVE_MEMORYLESS_NODES >> > shared the barn of the nearest NUMA node with memory. >> > >> > But now memoryless nodes will have their own barns (after patch 2) >> > regardless of CONFIG_HAVE_MEMORYLESS_NODES, and that's intentional, right? >> >> Yeah it improves their caching capacity, but good point, will mention it in >> the changelog. > > Thanks! just wanted to check that it was intentional. I wanted to update the changelog as promised. But realized that the change from numa_node_id() to numa_node_id() in get_barn() should actually be done only in patch 2, so I will move it there. In patch 1 that would mean no barns with CONFIG_HAVE_MEMORYLESS_NODES and thus a performance bisection hazard. > with that, please feel free to add: > Reviewed-by: Harry Yoo Thanks!