From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (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 760153CCA13 for ; Tue, 26 May 2026 08:00:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779782412; cv=none; b=WbTHB8RUhSEdxVEip4C7G7sYiWZlfc3DzxoUyef4cr+ADCHv/OHhN1rvR2K2EbbWySHnlRSBHXhSAsCnAgCV5A/sFH0ZFZIczKX6RZjj02wlRGsFTIzdElWug0+b6BmRMekc8/nGyEzkbvStVYQXxy3mvr4EKAfm4R4pRbAsya4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779782412; c=relaxed/simple; bh=kdcOjoIAObk+A6hI8moMEYIsth1nuPp5UFsmW40QmO4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IN2UZRmIUqWRXf2nYHTEI6y4VzyRbd1DpYFKUqrqntaO5VGxbJPHj7f62vL/9UFDt23CFj1XnmZ1eFwcIMie/P5iqpGCK6tmWHg1jhWjJKIuD0tEEl83KqMRg1Sgp9oJbJZhJYPuCVpK4ZMLdCL2rE/xpYy4g+DJzkX66dNSWeI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=U7n2d7Ha; arc=none smtp.client-ip=91.218.175.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="U7n2d7Ha" Date: Tue, 26 May 2026 15:59:58 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779782406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=G/mtLfTIcNnxuEgv7Gd34gqR3ftMO6U9fViw/IxnXBU=; b=U7n2d7Ha5IkwiSljUMk70AHc8aKAP9J4DmvYIhSGaRSXeLtU4l2PvgjTL89zVMJm6goU7O vRW1759Ie/s0RJz2OArTiW5JyGnSLGsj+XZK73Lx7GC9ys05xoZpsUJeAhp1LQPaNovsxS Y7mWH4vtNQWbyPtm4rdTFFLFbpDQNt0= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Hao Li To: Harry Yoo Cc: vbabka@kernel.org, akpm@linux-foundation.org, cl@gentwo.org, rientjes@google.com, roman.gushchin@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/slub: allocate sheaves on local memory nodes Message-ID: References: <20260525082312.16012-1-hao.li@linux.dev> <15f22716-0065-4814-8be3-7730ff34cf34@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15f22716-0065-4814-8be3-7730ff34cf34@kernel.org> X-Migadu-Flow: FLOW_OUT On Tue, May 26, 2026 at 03:56:58PM +0900, Harry Yoo wrote: > > > On 5/25/26 5:13 PM, Hao Li wrote: > > Sheaves are per-CPU allocator metadata and their object arrays are accessed > > from the local fast paths. Allocate them with a NUMA node hint instead of > > using plain kzalloc(). While no measurable performance improvement was > > observed, this approach is theoretically correct. > > > > During bootstrap we allocate sheaves for all possible CPUs before every > > possible CPU has an initialized cpu_to_mem() value, so compute the > > memory node from local_memory_node(cpu_to_node(cpu)) just like > > what __build_all_zonelists does. > > > What about sheaves for non-kmalloc-normal caches that are allocated & > initialized by init_percpu_sheaves()? Ah, good catch! Thanks for the reminder! I completely overlooked this, which unfortunately means most non-kmalloc caches have been missing out on the benefits of this patch. init_percpu_sheaves() also contain for_each_possible_cpu loops. It should also retrieve the node id from the cpu idx, rather than relying on numa_mem_id() inside alloc_empty_sheaf(). > > Would addressing above change "no measurable performance impact was > observed"? It looks like we should get some performance gains now. (Hope so:)) -- Thanks, Hao