From patchwork Thu Feb 10 22:49:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 12742600 Return-Path: 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 4D231C433EF for ; Thu, 10 Feb 2022 23:44:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE3476B0073; Thu, 10 Feb 2022 18:44:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C94116B0075; Thu, 10 Feb 2022 18:44:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B0D4A6B0078; Thu, 10 Feb 2022 18:44:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id 9D9996B0073 for ; Thu, 10 Feb 2022 18:44:52 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 59A8590931 for ; Thu, 10 Feb 2022 23:44:52 +0000 (UTC) X-FDA: 79128502824.23.57422CF Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by imf19.hostedemail.com (Postfix) with ESMTP id DC3A11A0002 for ; Thu, 10 Feb 2022 23:44:51 +0000 (UTC) Received: by mail-qt1-f181.google.com with SMTP id z1so7270842qto.3 for ; Thu, 10 Feb 2022 15:44:51 -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=kme7HdDPBLdZ4YQtPbT4M8C1s/pmrIz1qdi0gwByHEo=; b=Bk7rx9gKhdGsR9i8jgVS556YE2ujf0DSOvVCpTdc9PT65IOYqaQn9aot/Y9Xwof7ki cOnVYvWJbPeDast2MgmpVU8Y4Imurlc5MhQl99D0snMgl+6Gu4ehybSGgqRGOefPOoBX 5PEfm69qkAlLEYPK6MkW0jclxUqt7bd8ulqPZGiRaFYvX9dZSOUqEUCbmBDOYFYCflDj g0rF49yNULJKrkgSYVUWolWWUDbQHWS3s4jqHjk5D/DAtrm+AgzV8WvsVC9KB33nSjTz AtmQPfPBeTjUMZLE49hquJI0Dt7lAFl1HT2b050DpuOl8+hOzXAF14k5nUPeiK20UT0y Zq5Q== 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=kme7HdDPBLdZ4YQtPbT4M8C1s/pmrIz1qdi0gwByHEo=; b=Hh75WpT4+Q738pYgXOvijixW2QtEXtkUsiA0vC9bf1VGX0oxkMC2mivu2aOEMR2F2P GcwqFUpvuuzLk51kW7rUDe625vxpZnkPGLStfHGP66qb6fpE41UuRCzDPqoj2BKHc9Ca sXr5PmwsKB2h1EjV/tZZVca6DNIXIkXCVPTsLTFihChsECTVpO/z2BQJEdK3icoyS5Mc 7cL7p00rRwk0/TObt7ImxwrLldJrRT1TYETePa8dxlSCmdq8FDVs8g3F0NBF6BMB+m36 3Xco8tR/oDnx16Iqs0J9MJJBRRwRGSAO0/eGs5zU3e+tzYOdcDWqFL5C78lupMprQSWk Nikg== X-Gm-Message-State: AOAM5309T3n45WbuUGsAUwoy8VYU6SyRas7ck+fTQPmCznn2ozO8yBEj xW2iwPOuIGNFmD9xJ69rlog= X-Google-Smtp-Source: ABdhPJweRk+ewB0DrkLNcDIrsEhPbiqs1Kx+pnRXJsHT5Dn4ekm9Sd6GVVslYeAffagwYjFFuj89hQ== X-Received: by 2002:ac8:5711:: with SMTP id 17mr6533353qtw.287.1644536691131; Thu, 10 Feb 2022 15:44:51 -0800 (PST) Received: from localhost ([12.28.44.171]) by smtp.gmail.com with ESMTPSA id w10sm12500893qtj.73.2022.02.10.15.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 15:44:50 -0800 (PST) From: Yury Norov To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Andrew Morton , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , Greg Kroah-Hartman , Peter Zijlstra , David Laight , Joe Perches , Dennis Zhou , Emil Renner Berthing , Nicholas Piggin , Matti Vaittinen , Alexey Klimov , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 24/49] mm/vmstat: replace cpumask_weight with cpumask_empty where appropriate Date: Thu, 10 Feb 2022 14:49:08 -0800 Message-Id: <20220210224933.379149-25-yury.norov@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210224933.379149-1-yury.norov@gmail.com> References: <20220210224933.379149-1-yury.norov@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: DC3A11A0002 X-Stat-Signature: 1q9ktog6c76e1ad8pp1s5fmj7yxf86u7 X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Bk7rx9gK; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf19.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.160.181 as permitted sender) smtp.mailfrom=yury.norov@gmail.com X-HE-Tag: 1644536691-52355 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: mm/vmstat.c code calls cpumask_weight() to check if any bit of a given cpumask is set. We can do it more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov Acked-by: Mike Rapoport --- mm/vmstat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/vmstat.c b/mm/vmstat.c index d5cc8d739fac..27a94afd4ee5 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -2041,7 +2041,7 @@ static void __init init_cpu_node_state(void) int node; for_each_online_node(node) { - if (cpumask_weight(cpumask_of_node(node)) > 0) + if (!cpumask_empty(cpumask_of_node(node))) node_set_state(node, N_CPU); } } @@ -2068,7 +2068,7 @@ static int vmstat_cpu_dead(unsigned int cpu) refresh_zone_stat_thresholds(); node_cpus = cpumask_of_node(node); - if (cpumask_weight(node_cpus) > 0) + if (!cpumask_empty(node_cpus)) return 0; node_clear_state(node, N_CPU); From patchwork Thu Feb 10 22:49:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 12742625 Return-Path: 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 90A40C433F5 for ; Fri, 11 Feb 2022 00:33:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C38226B0073; Thu, 10 Feb 2022 19:33:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BE6C86B0075; Thu, 10 Feb 2022 19:33:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AAF4D6B0078; Thu, 10 Feb 2022 19:33:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0054.hostedemail.com [216.40.44.54]) by kanga.kvack.org (Postfix) with ESMTP id 9CE356B0073 for ; Thu, 10 Feb 2022 19:33:32 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6255595B0B for ; Fri, 11 Feb 2022 00:33:32 +0000 (UTC) X-FDA: 79128625464.25.C1DC085 Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by imf13.hostedemail.com (Postfix) with ESMTP id 1865820009 for ; Fri, 11 Feb 2022 00:33:31 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id e79so9500250iof.13 for ; Thu, 10 Feb 2022 16:33:31 -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=r/11QztAgc7p887H2JROAx8muQu/2OLTeRvuBg6maFg=; b=ok4tnMvC7LNlEY46BePrt8wMU+Xygc1lZ1J4h61Xtojbzh341QW8CBnitkhh5WqB3/ XQn5p4hMW9VVGbkJ9OqMDwRUWIdHv5YGA1+MudlaHItROlN0ZWP+huOqrDwFHv9Z8QR6 kAQBAsudTSUpOAzB8WSpovQie3Y9Oejz4Ny6jolkns7yygmDKtkLzivE4oMh3a2eFa0Q blKT0mttPX3VUmJXZcZg9AeE3k4/82VYbeWrmKV+2djpYxOF+Z8FLRVT7aZJzk3HNEyf zId6ynUThngQhyEuB4bOApoKZZXjGDOOJNdj8JSWbzBBA7Maj1PC2m2E0xgnM+DZdPL7 xKnw== 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=r/11QztAgc7p887H2JROAx8muQu/2OLTeRvuBg6maFg=; b=h1SwW5N5V7DaDqLQ2lEROnLDbLROWtXdwvkN+0C6M1NB1yqYRoz4H0xDo98v2bBFuq JFSR9IPf2Pd/DSimQwVnmldjbTEpYEXPd3t03K9gEd4b9YlC8drLa3vHVGCxsj795pbS 4tTLW4rEIJDe1NI67Bl1efcCEgKDA7Go0RIrg25gxgqj24jFSoubl3AAhXYmvSN4ntbx Zu23Mbr4l2M9FBEi69Nu9Jk1wVj99GUYeWaCbgdGA+K7eRpIZk8ExUOQHPpCPel41rT3 KeTJS8I/jSROv3WP43qTxi1r87sj4/Zux7FhWVIfG+ZWmiKTu0drJj+sjPSg5r8aoS5o gnLA== X-Gm-Message-State: AOAM530SFOqFzISzkLCR0I23EZPK6M9Mw1Fzq1yr2/sjSYyNBy3WtiZC yxpnT7XOv3CAyry4AeWkaqc= X-Google-Smtp-Source: ABdhPJyzos5XlKp1kunYx0r5VshfNF8Q0FlI8L2FzcjJPMYDnSfr0hH9Cw5PSnXX0u86MmWYjJr03Q== X-Received: by 2002:a02:3f2f:: with SMTP id d47mr5568535jaa.228.1644539611330; Thu, 10 Feb 2022 16:33:31 -0800 (PST) Received: from localhost ([12.28.44.171]) by smtp.gmail.com with ESMTPSA id 193sm3856876iob.17.2022.02.10.16.33.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 16:33:31 -0800 (PST) From: Yury Norov To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Andrew Morton , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , Greg Kroah-Hartman , Peter Zijlstra , David Laight , Joe Perches , Dennis Zhou , Emil Renner Berthing , Nicholas Piggin , Matti Vaittinen , Alexey Klimov , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 46/49] mm/mempolicy: replace nodes_weight with nodes_weight_eq Date: Thu, 10 Feb 2022 14:49:30 -0800 Message-Id: <20220210224933.379149-47-yury.norov@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210224933.379149-1-yury.norov@gmail.com> References: <20220210224933.379149-1-yury.norov@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 1865820009 X-Stat-Signature: ha8aszqxzmibinzjqur358bnyu14ijx6 X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ok4tnMvC; spf=pass (imf13.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.166.46 as permitted sender) smtp.mailfrom=yury.norov@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam06 X-HE-Tag: 1644539611-873944 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: do_migrate_pages() calls nodes_weight() to compare the weight of nodemask with a given number. We can do it more efficiently with nodes_weight_eq() because conditional nodes_weight() may stop traversing the nodemask earlier, as soon as condition is (or is not) met. Signed-off-by: Yury Norov Acked-by: Mike Rapoport --- mm/mempolicy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 7c852793d9e8..56efd00b1b6e 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1154,7 +1154,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, * [0-7] - > [3,4,5] moves only 0,1,2,6,7. */ - if ((nodes_weight(*from) != nodes_weight(*to)) && + if (!nodes_weight_eq(*from, nodes_weight(*to)) && (node_isset(s, *to))) continue; From patchwork Thu Feb 10 22:49:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 12742630 Return-Path: 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 1A930C433EF for ; Fri, 11 Feb 2022 00:35:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 704FD6B0073; Thu, 10 Feb 2022 19:35:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B4306B0075; Thu, 10 Feb 2022 19:35:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 555586B0078; Thu, 10 Feb 2022 19:35:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id 48B036B0073 for ; Thu, 10 Feb 2022 19:35:44 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 028F5824C420 for ; Fri, 11 Feb 2022 00:35:44 +0000 (UTC) X-FDA: 79128631008.29.3D7C361 Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by imf03.hostedemail.com (Postfix) with ESMTP id 9AA7420008 for ; Fri, 11 Feb 2022 00:35:43 +0000 (UTC) Received: by mail-qt1-f170.google.com with SMTP id k25so7399466qtp.4 for ; Thu, 10 Feb 2022 16:35:43 -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=OWAdmxyB++0+PrjBMyb2j1q4M+ZTDvPBI87BwMKOTA4=; b=px25tVfseTRg17nKrinckLpm5Os6T2EDwYc8LKgshVBbe8wsdoAH40zqblIKerCD/M 9FOLPx46bt7sHkinZB7cbxFBdikM66T7mIE2f+XeWCQEEWgZ6+Fj8c60iMtssJ2j4Ax5 ywQwibJ3q+gTnIvO+B0epbOGU2k7wcFwtAmB2Ekl9ZcADK2LwleSSxyJRs3DD/O5DZ2q 3TtJYkbVmKfY7d2ve4Ep5xreuUGke1oZrOtsnTBOvbkyt9qrnwapvEabYRk+An2u5fDB srQ7MLPu2N9T8Fk0fsc3+eu95bT6srOmeEd1PY3YKp7ljCULaG+YIorAkRi025pE/HtS At7Q== 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=OWAdmxyB++0+PrjBMyb2j1q4M+ZTDvPBI87BwMKOTA4=; b=VXU5GN3wos6p2CTNBEQZCJQl/+75lDVMREKT8pLnV2gIJoQtnvqd+F2+fFPXWSakq6 9Gzu9DO7KHSxcf3JrHhdwcSyo2LrZvdiS8UVrYMFWgohy6bHxYkleLFZagA1ht341ayr zdXzSaOPji/xPTKfAZwTTVUwFkBz+ThO/TkHpRjPqwKbIZVchUmJjREPCZEaBwd26xET Z3qU1e7tWxhbb4Z//n48E4P23pWSxeRlBs7qzUHIJBmw4KhaXQBmJ1Mq2Yc/88bGm6dk aZMLjYuMjsMng3uE/vvSOEK1lHzqSvrvp0k6YfpBo5KrKsKupt+/f7T6V9CjUUTJt71i FQzg== X-Gm-Message-State: AOAM532RuO1yfNYwPSRupAxYEm6sUWURBHefUYOoW6x1x5OoPdV0rxpR ayHBSVTyVtmm4u5s25ZTW2U= X-Google-Smtp-Source: ABdhPJwKE/7L+78ImyHSzKItwQ+7D0kCNRZ6HRgstwY/P0UGJdT1+mnItTy7cbAEdrMnsxIjkAmO9Q== X-Received: by 2002:ac8:5747:: with SMTP id 7mr6794649qtx.95.1644539742833; Thu, 10 Feb 2022 16:35:42 -0800 (PST) Received: from localhost ([12.28.44.171]) by smtp.gmail.com with ESMTPSA id k13sm11581386qko.45.2022.02.10.16.35.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 16:35:42 -0800 (PST) From: Yury Norov To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Andrew Morton , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , Greg Kroah-Hartman , Peter Zijlstra , David Laight , Joe Perches , Dennis Zhou , Emil Renner Berthing , Nicholas Piggin , Matti Vaittinen , Alexey Klimov , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 47/49] nodemask: add num_node_state_eq() Date: Thu, 10 Feb 2022 14:49:31 -0800 Message-Id: <20220210224933.379149-48-yury.norov@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210224933.379149-1-yury.norov@gmail.com> References: <20220210224933.379149-1-yury.norov@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9AA7420008 X-Stat-Signature: thprtpyqqbeh1hu53oohzsstbbnrbaq6 X-Rspam-User: Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=px25tVfs; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf03.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.160.170 as permitted sender) smtp.mailfrom=yury.norov@gmail.com X-HE-Tag: 1644539743-915133 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: Page allocator uses num_node_state() to compare number of nodes with a given number. The underlying code calls bitmap_weight(), and we can do it more efficiently with num_node_state_eq because conditional nodes_weight may stop traversing the nodemask earlier, as soon as condition is (or is not) met. Signed-off-by: Yury Norov Acked-by: Mike Rapoport --- include/linux/nodemask.h | 5 +++++ mm/page_alloc.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 197598e075e9..c5014dbf3cce 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h @@ -466,6 +466,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, 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 cface1d38093..897e64b66ca4 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8434,7 +8434,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