Message ID | 20211128035704.270739-9-yury.norov@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD7A5C433F5 for <linux-mm@archiver.kernel.org>; Sun, 28 Nov 2021 04:01:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0BB976B0083; Sat, 27 Nov 2021 22:57:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 06BAA6B0085; Sat, 27 Nov 2021 22:57:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD9956B0087; Sat, 27 Nov 2021 22:57:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0068.hostedemail.com [216.40.44.68]) by kanga.kvack.org (Postfix) with ESMTP id CFF286B0083 for <linux-mm@kvack.org>; Sat, 27 Nov 2021 22:57:32 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 966EB8D8C1 for <linux-mm@kvack.org>; Sun, 28 Nov 2021 03:57:22 +0000 (UTC) X-FDA: 78856979376.05.8EFF9A3 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by imf04.hostedemail.com (Postfix) with ESMTP id 7CE0F50000BE for <linux-mm@kvack.org>; Sun, 28 Nov 2021 03:57:17 +0000 (UTC) Received: by mail-qk1-f169.google.com with SMTP id de30so19140965qkb.0 for <linux-mm@kvack.org>; Sat, 27 Nov 2021 19:57:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=hB7XWgK7LBArYWsovgo0hsN0mrEB+cbVCvcU6LAXOLQ=; b=bkO3RJSSz1q8yvgEs+aBx5zXdnHBh9vFE6t8K7gDrhv51/j08hfhIkoHZaR/hn0oT/ R5HW1Le+kJ7J5+j08nxMmOUbGwurX3jUtdCYh4qnp093YPNTDx3I2obkRNvgb1w4e6pj 20cOR+h9Hj8GDzSc89ENg7eJfWrZuKRaBeX9GAKduwkkEgkAkB7qN396A8vk8b/gpptx lWvzTq98DWDhCaiZGFj4lz8We1hTY+eK3ZvJ8DsZ97WxcyB1Qm6Iy+DeJcwlAc16vl5d v0TmwDCWDRdqoBv9V5pT7/kRMNKnADy/OKnNxEaVc6tfFvf0HsopsZA5YMI6DSLZ3NwQ BUew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hB7XWgK7LBArYWsovgo0hsN0mrEB+cbVCvcU6LAXOLQ=; b=1BRG366Vh/UDEMiTZclJoHKcCx+T5PGUV1UxKhu3kzFbFWavxRcX2rmgDHEo/qBiRX gwOngjl6BItneEq++4m5x2l08GZkNjOJvLeUY4GV++fAWcUzVXur8jnaguyJk3WPXtlh bql5XST/f03wlKhMuRwzW7ffTWg9AGmQA7c55irSXbihLlrNs6ysV7Bz4LQSJMbu8pZe V4hOcOKk+1ub5NDju2yUcgVFtnBQP0zpZXdV6GwQ0OkOBqyC3KgVWfQugNJN0cH1uiR5 m752XyADKdArkMMaG8YtX4suFuj8drIOpZ0/8o4duwJ+2nC506fSuGLOrf4rDuGE9t50 p89w== X-Gm-Message-State: AOAM5302LzBCkRjkvWymVRtpn+hNn4IzIfLELg7l7iMeGh09A1sIVz5t SUZWxCkZtwzcc5WHLo2kh1M= X-Google-Smtp-Source: ABdhPJyFEyV7d/B7VRKVyGGE2Y5zpuLAq61KyIGr2PtJ6cIeT64BguOqkxtxJnawWvNd51HKw7WvIQ== X-Received: by 2002:a05:620a:1713:: with SMTP id az19mr31179988qkb.297.1638071841520; Sat, 27 Nov 2021 19:57:21 -0800 (PST) Received: from localhost ([66.216.211.25]) by smtp.gmail.com with ESMTPSA id c11sm6161985qtb.8.2021.11.27.19.57.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Nov 2021 19:57:21 -0800 (PST) From: Yury Norov <yury.norov@gmail.com> To: linux-kernel@vger.kernel.org, Yury Norov <yury.norov@gmail.com>, "James E.J. Bottomley" <jejb@linux.ibm.com>, "Martin K. Petersen" <martin.petersen@oracle.com>, "Paul E. McKenney" <paulmck@kernel.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Alexey Klimov <aklimov@redhat.com>, Amitkumar Karwar <amitkarwar@gmail.com>, Andi Kleen <ak@linux.intel.com>, Andrew Lunn <andrew@lunn.ch>, Andrew Morton <akpm@linux-foundation.org>, Andy Gross <agross@kernel.org>, Andy Lutomirski <luto@kernel.org>, Andy Shevchenko <andy@infradead.org>, Anup Patel <anup.patel@wdc.com>, Ard Biesheuvel <ardb@kernel.org>, Arnaldo Carvalho de Melo <acme@kernel.org>, Arnd Bergmann <arnd@arndb.de>, Borislav Petkov <bp@alien8.de>, Catalin Marinas <catalin.marinas@arm.com>, Christoph Hellwig <hch@lst.de>, Christoph Lameter <cl@linux.com>, Daniel Vetter <daniel@ffwll.ch>, Dave Hansen <dave.hansen@linux.intel.com>, David Airlie <airlied@linux.ie>, David Laight <David.Laight@ACULAB.COM>, Dennis Zhou <dennis@kernel.org>, Dinh Nguyen <dinguyen@kernel.org>, Geetha sowjanya <gakula@marvell.com>, Geert Uytterhoeven <geert@linux-m68k.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Guo Ren <guoren@kernel.org>, Hans de Goede <hdegoede@redhat.com>, Heiko Carstens <hca@linux.ibm.com>, Ian Rogers <irogers@google.com>, Ingo Molnar <mingo@redhat.com>, Jakub Kicinski <kuba@kernel.org>, Jason Wessel <jason.wessel@windriver.com>, Jens Axboe <axboe@fb.com>, Jiri Olsa <jolsa@redhat.com>, Jonathan Cameron <jic23@kernel.org>, Juri Lelli <juri.lelli@redhat.com>, Kalle Valo <kvalo@codeaurora.org>, Kees Cook <keescook@chromium.org>, Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>, Lee Jones <lee.jones@linaro.org>, Marc Zyngier <maz@kernel.org>, Marcin Wojtas <mw@semihalf.com>, Mark Gross <markgross@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Matti Vaittinen <mazziesaccount@gmail.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Mel Gorman <mgorman@suse.de>, Michael Ellerman <mpe@ellerman.id.au>, Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>, Nicholas Piggin <npiggin@gmail.com>, Palmer Dabbelt <palmer@dabbelt.com>, Peter Zijlstra <peterz@infradead.org>, Petr Mladek <pmladek@suse.com>, Randy Dunlap <rdunlap@infradead.org>, Rasmus Villemoes <linux@rasmusvillemoes.dk>, Roy Pledge <Roy.Pledge@nxp.com>, Russell King <linux@armlinux.org.uk>, Saeed Mahameed <saeedm@nvidia.com>, Sagi Grimberg <sagi@grimberg.me>, Sergey Senozhatsky <senozhatsky@chromium.org>, Solomon Peachy <pizza@shaftnet.org>, Stephen Boyd <sboyd@kernel.org>, Stephen Rothwell <sfr@canb.auug.org.au>, Steven Rostedt <rostedt@goodmis.org>, Subbaraya Sundeep <sbhatta@marvell.com>, Sudeep Holla <sudeep.holla@arm.com>, Sunil Goutham <sgoutham@marvell.com>, Tariq Toukan <tariqt@nvidia.com>, Tejun Heo <tj@kernel.org>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Thomas Gleixner <tglx@linutronix.de>, Ulf Hansson <ulf.hansson@linaro.org>, Vincent Guittot <vincent.guittot@linaro.org>, Vineet Gupta <vgupta@kernel.org>, Viresh Kumar <viresh.kumar@linaro.org>, Vivien Didelot <vivien.didelot@gmail.com>, Vlastimil Babka <vbabka@suse.cz>, Will Deacon <will@kernel.org>, bcm-kernel-feedback-list@broadcom.com, kvm@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-csky@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-snps-arc@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 8/9] lib/nodemask: add num_node_state_eq() Date: Sat, 27 Nov 2021 19:57:03 -0800 Message-Id: <20211128035704.270739-9-yury.norov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211128035704.270739-1-yury.norov@gmail.com> References: <20211128035704.270739-1-yury.norov@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 7CE0F50000BE X-Stat-Signature: 76satpqsp7uqeeihq9rczfkonrbi7y1t Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=bkO3RJSS; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.222.169 as permitted sender) smtp.mailfrom=yury.norov@gmail.com X-HE-Tag: 1638071837-875605 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
lib/bitmap: optimize bitmap_weight() usage
|
expand
|
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 3801ec5b06f4..b68ee2a80164 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h @@ -455,6 +455,11 @@ static inline int num_node_state(enum node_states state) return nodes_weight(node_states[state]); } +static inline int num_node_state_eq(enum node_states state, unsigned int num) +{ + return nodes_weight_eq(node_states[state], num); +} + #define for_each_node_state(__node, __state) \ for_each_node_mask((__node), node_states[__state]) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 91c1105a9efe..81d111155ffb 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8323,7 +8323,7 @@ void __init page_alloc_init(void) int ret; #ifdef CONFIG_NUMA - if (num_node_state(N_MEMORY) == 1) + if (num_node_state_eq(N_MEMORY, 1)) hashdist = 0; #endif
Add num_node_state_eq() and replace num_node_state() with it in page_alloc_init(). Signed-off-by: Yury Norov <yury.norov@gmail.com> --- include/linux/nodemask.h | 5 +++++ mm/page_alloc.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)