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=1796039476; b=gL61SlGTjCKdecORIhPfSeUNjgKtyBct1GrlAGt+M98Fbq5Qs2VAl2Mhzh0/6X+AVtKY jAD5k0BlQoIatchpB2qFgbpgJsUV8mEENpaxYSW9iz21gRBVueDyDSEHXplp82GEbkKX1 JMYZVmkd6g/hH27I2k6PlkIF+BV5b/SXQsATDpkkn0E59Xwp6aPeMf9Z9Pfcv9iFPXImn woQBLxqC3QLoN3hHowF2vRGtKGp42BxzxRuM/2hoh6ZJ+Lrw5KtKPHj5AQPnakCl9i2UT aMY0Myq6dZqaqUhol1ViGpiY6zwxSmxZ4GuNIltvW19jFgnhTgT+kX7MVT/NZERgI3g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796039476; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=9DyK6h6CJiWyKcEVoUZFipZfzZTHRYThVPvyONO977s=; b=mYqgEcc44bJKfHS4IGsA/MUd2KPOt91kJdS86mt9caySzSsZinq15Mb92pRozm4z/X1r YMP1jHBvd7ZUjsSHvjgtO3XJy3XEAC6/PEXLPtSqtikgVUqk/lsR3189WsVR1V0JJB9OB /9zFu8PwCLfuf7WyM+wP76vWCECnCXmfw5aY/OQb9u/ggeSjtlcp7BOMcIYMYBxWLpv6e Hu8/THfXARaSRb+IhFflRr6tYJDRebARiaf8bVoEmIIXkx7rXAEjKlbjE2MMntwmfMCQu Yowc0R/IMq5hF5WI7VrqAAjIvqzA5TjvovbLNBXWmoBqu7KWDoks4CduIiX476atFyA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nAqOR7AW; 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 223B5606A32E; Mon, 30 Nov 2026 11:51:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nAqOR7AW Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D42D1F00926; Mon, 30 Nov 2026 11:51:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796039475; bh=9DyK6h6CJiWyKcEVoUZFipZfzZTHRYThVPvyONO977s=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=nAqOR7AWOUFUrfCH9og+Zo00svz8Hz3jtzCi6ti8eZuCCGpkU608zW2htlDV/tlSC EPNJ316hqYQmdPFVq9Vv7H+Y2drkPeXZmb9K+dcwBlK0LvI2DnnHkAwD/qysTQK+tX 0EIGfxTfGT2meEMNHQ62lTlnvXmJ8LABmMV3lmIL0UjpQHmdKE2pNek2N+y9m/ZNKm DkJOGVRLpzQqgnq6JkcCz3vL8lqSvI30l8se3dRQGnASS44xCuWtwwnbxTkEJi5+UY GDwI4xakjssSQ9BDR9nTEMDSy7lr9haQ/L3rImAeUKOrl/Muy0zb0Re/irH2S1zDTJ dCoRQM8nfjNSw== Date: Mon, 30 Nov 2026 11:51:02 +0000 From: "Lorenzo Stoakes (ARM)" To: Yury Norov Cc: linux-kernel@vger.kernel.org, Andrew Morton , 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 , 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: References: <20261127230128.111933-1-ynorov@nvidia.com> X-Mailing-List: linux-trace-kernel@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-Disposition: inline In-Reply-To: <20261127230128.111933-1-ynorov@nvidia.com> On Fri, Nov 27, 2026 at 06:01:17PM -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. > > 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. > > Yury Norov (11): > nodemask: add 'small' and 'large' compile-time sizes > nodemask: pass nodemask length to node search functions > mm/mempolicy: reject migrate_pages source IDs beyond nr_node_ids > mm/mempolicy: preserve full-width userspace nodemasks > mm: switch to runtime nodemask length > MIPS: IP27: switch nmi_dump to runtime nodemask length > ACPI: NUMA: switch acpi_map_pxm_to_node to runtime nodemask length > mtip32xx: switch next_online_node() to runtime nodemask length > nodemask: add nodes_copy_and_extend() > sched/numa: bound cpuset trace masks by nr_node_ids > nodemask: add cpumask-style operation size bounds > > arch/mips/sgi-ip27/ip27-nmi.c | 2 +- > drivers/acpi/numa/srat.c | 2 +- > drivers/block/mtip32xx/mtip32xx.c | 2 +- > include/linux/nodemask.h | 122 +++++++++++++++++++----------- > include/trace/events/sched.h | 7 +- > mm/hugetlb_internal.h | 2 +- > mm/mempolicy.c | 55 +++++++++----- > mm/mmzone.c | 2 +- > mm/vmscan.c | 2 +- > 9 files changed, 123 insertions(+), 73 deletions(-) Thanks, given the current AI-generated fix onslaught I'm not quite sure if we're looking to take anything non-fixy further this cycle ([0]). David, what do you reckon? -- Cheers, Lorenzo [0]: https://lore.kernel.org/linux-mm/a2f584f6-e382-4876-aa6d-d5a34de6ee59@kernel.org/