From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795909241; b=0ef0FaCs5eM1FAUQ0P6gGik7CPr06YcTLyXWMstvaRhvuiiEScsLgI3Kf4zve/tfLYRx kTZP9D9b1KGOqMNnQExCZS3GX4I+W3cv7zbqQ9AaM7rtWaUfOHWPW/SkHkdjzS2dsqbAt SNcFdQOKVaUl38aJQ/0rT9mZb5DUyG1oXliXr5jgYGiHFeGWBiWyk/0uMFd9tmBOX00RK 9smT8eN3HRNDW1ANqkK5iAXTaAmy1KhyI2LLY4OW0j2qtWyYNFb8Zd+W7VqIYlBQtoYqw /fILKrkOGUsoATVGZk7Cdv+aVv2qHZZJEY9IRJxBpOC0IIqVEMNlvqk8LWd9rcGTlcw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795909241; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-Id: In-Reply-To:References:X-Mailer:Mime-Version:Content-Type: Content-Transfer-Encoding; bh=8PmnhVIuIKY8G0g86sviJVK9YUTagNxD01L8f+dCJ2U=; b=EsIitPSiV9m8YmEfaESaFc1PWixew4Lbn7Mn2uQ/taVTno0ZTzw+v7qRfu8zVhWZds2s oOaLnxK076+dG3/AR/kLEj0aMcnvtqlYgdzSYgQHguOorrrnt+0n1JxY5/pWemdIdZ8SY 4/AnyT4H2NJtqOvu7txWG+Y3fBspfcLsXkMEOG5wL1rw6LcT14+2brC20GSpTOiie6vLY 3/HDEpPOarmWvXatxFE0QCwLf6RcNAl/QLAaBgXveHtKYyqfemqzoScrTO+yyPjALAuPp Kj1eEtv6JCsl7zIeTTW2Xf8cyMsY4/EZcBihtTND5NWGwsx7cDy1mvlzD+JYy4CUERg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=i3Lrp9CK; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42E4F606A339; Sat, 28 Nov 2026 23:40:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=i3Lrp9CK Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B2D91F00893; Sat, 28 Nov 2026 23:40:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1795909240; bh=8PmnhVIuIKY8G0g86sviJVK9YUTagNxD01L8f+dCJ2U=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=i3Lrp9CKALiBSz+qf46ep3ACeZGa+4Mrol5JQKStAvsRUZANY1VmDU+vRu2tl5UpU 1gQUoV0lu2bIzUWx1RprAnRfFdnXvUzJNpLHp/GpvpglY7EYp664QtE973Q04vxSV/ 5YuJGyTnMRw6CnezmD7poHjsgsh60WcwemfsIDwg= Date: Sat, 28 Nov 2026 15:40:39 -0800 From: Andrew Morton To: Yury Norov Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Rasmus Villemoes , David Hildenbrand , Gregory Price , Zi Yan , Joshua Hahn , Rakie Kim , Ying Huang , Muchun Song , Oscar Salvador , Johannes Weiner , Kairui Song , Thomas Bogendoerfer , "Rafael J. Wysocki" , Len Brown , Jens Axboe , Peter Zijlstra , Mel Gorman , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , linux-mips@vger.kernel.org, linux-acpi@vger.kernel.org, linux-block@vger.kernel.org, linux-trace-kernel@vger.kernel.org, "Liam R. Howlett" , Axel Rasmussen , Baolin Wang , Baoquan He , Barry Song , Linus Torvalds , Lorenzo Stoakes , Michal Hocko , Mike Rapoport , Qi Zheng , Shakeel Butt , Suren Baghdasaryan , Vlastimil Babka , Wei Xu , Yuanchu Xie , Yury Norov Subject: Re: [PATCH 00/11] nodemask: switch to runtime nr_node_ids Message-Id: <20261128154039.e898002e7af1e8af883c6c8a@linux-foundation.org> In-Reply-To: <20261127230128.111933-1-ynorov@nvidia.com> References: <20261127230128.111933-1-ynorov@nvidia.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 27 Nov 2026 18:01:17 -0500 Yury Norov wrote: > Nodemasks have a compile-time capacity of MAX_NUMNODES, and > nr_node_ids describes the runtime node ID usage. > > Modern distros, like my Ubuntu, default MAX_NUMNODES to 1024, while the > actual number of nodes is typically smaller. All nodemask functions > currently refer to the MAX_NUMNODES, which adds a substantial overhead > on every traversing operation. > Thanks Yury, this is a worthy effort! First thought: mainline Linux defaults x86_64 MAX_NUMNODES to 64. But 99.9% of our users say "well that's crap, let's use X instead". The below is unreliable and very approximate, but my LLM's scouring turned up the following guesstimates: Who MAX_NUMNODES RHEL 1024 SUSE 1024 Oracle 1024 Ubuntu 1024 Debian 1024 Fedora 1024 AWS ~1024 Google ~64 Microsoft ~1024 Meta ~64-1024 Tencent ~1024 I suggest that we change mainline's default so what-we're-testing better represents what-they're-using. This somewhat offtopic, but wdyt? Would such a change affect this patchset? > This series switches the kernel to runtime length of nodemasks, which > also saves up to 8K of .text for minimal config, and accelerates basic > nodemask operations ~4x if MAX_NUMNODES == 1024 and nr_node_ids == 2. I'm saddened by how many instances of MAX_NUMNODES remain in the tree! I'd love to see that become zero. But that would involve using alloca() or its equivalents. I think alloc() is neat but I've always lost that fight (LT), never really understood why. Series looks nice, applies cleanly for me. Sashiko said a thing (https://sashiko.dev/#/patchset/20261127230128.111933-1-ynorov@nvidia.com). I'll continue to monitor, see what reviewers have to say (please).