From patchwork Fri Feb 26 20:17:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 12107319 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15D1BC433E0 for ; Fri, 26 Feb 2021 20:18:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4AF0264DA3 for ; Fri, 26 Feb 2021 20:18:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AF0264DA3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 82AC96B0074; Fri, 26 Feb 2021 15:18:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D9116B0075; Fri, 26 Feb 2021 15:18:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C9B76B0074; Fri, 26 Feb 2021 15:18:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0227.hostedemail.com [216.40.44.227]) by kanga.kvack.org (Postfix) with ESMTP id 53EE06B0005 for ; Fri, 26 Feb 2021 15:18:24 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 11B8B83E1 for ; Fri, 26 Feb 2021 20:18:24 +0000 (UTC) X-FDA: 77861531328.15.024E536 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf03.hostedemail.com (Postfix) with ESMTP id 2BA53C0001FE for ; Fri, 26 Feb 2021 20:18:18 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id e9so3980820pjs.2 for ; Fri, 26 Feb 2021 12:18:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=subject:date:message-id:mime-version:content-transfer-encoding:cc :from:to; bh=FP++fkW38doZ9W2MYsX+Ulsxt6WryiBxofgzcF/5/4U=; b=Pu588gcoreQtwND83Deks/i9eB0usYHVKKnptjesTTx20IEpTyioW58+m/4Sgi/Cga ToQuxUfrD6KNDYF58y42Qfe7mDyf60sQ9QGyT4tHT6zeVsChJ1E1sscoKdKnE+U28/gb ZD7zBxAt4YIjYEf3dE+6k6FS/2kaWF9smvxp9cD9mOiuW/g0R/yjnUYD0hvlOu4SoPOu hac7YWq5b0tnnak9mMLatdaiinTs4xmzPC0vcMpu+8LcDAE/qurvRk7XoiljdaXejB7q 4PJ7VBngaas9LwXmIRz3aQq4srO7QQ5e8+rvuRVVEPglJ3lNThs7iVTrQDOeSt7qlyb5 Pv8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:mime-version :content-transfer-encoding:cc:from:to; bh=FP++fkW38doZ9W2MYsX+Ulsxt6WryiBxofgzcF/5/4U=; b=S2yAPIqCLMDKdUD88mwSal/ToTeJO32x1XOQjRseiOT73lWVgKQWuJbcvTxKXXKv3v C/fq7/u4dLQh3+iGuuVGMaaDSd8qOOFxTVuQ8chMpdMPdzKJPn0pJaFK2LKcRYqPsgIm cURYm6KLQhpW0pwtCNEDEYXc1Y9wuKXwCMnbR9xK0sijL7X+vEKBpr1nzv9wwNRrnIB1 pbqm1h5hvykVTsPOQ7fQTpPb8Nu0pGhfbtBKECC6gNCfRd9L/4HXiMmuETBPBgGr0Uo7 O0kVbezfvXh5N/mm0/67b/cA13PdO5e+LRxISg059NXpVb0s10v+JwGSKHKl7v97OoXx ZXeQ== X-Gm-Message-State: AOAM5321Ayzjwex911NlzKfslB/0tW7oYuQv3JAcVxwSmMwVcRKFZhsD 7F50DXZsE6t5p+Gpz91T9VwExA== X-Google-Smtp-Source: ABdhPJz2k7Wd54A2UtRRtpS+NGvOx76/1827VyL9ji5paADxoZbNJx9OLEmXkc7EX4mOqAmkNY2DqA== X-Received: by 2002:a17:90b:1910:: with SMTP id mp16mr5067925pjb.0.1614370700158; Fri, 26 Feb 2021 12:18:20 -0800 (PST) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id y6sm672139pfm.99.2021.02.26.12.18.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Feb 2021 12:18:19 -0800 (PST) Subject: [PATCH 1/2] mm: Guard a use of node_reclaim_distance with CONFIFG_NUMA Date: Fri, 26 Feb 2021 12:17:20 -0800 Message-Id: <20210226201721.510177-1-palmer@dabbelt.com> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog MIME-Version: 1.0 Cc: peterz@infradead.org, srikar@linux.vnet.ibm.com, valentin.schneider@arm.com, vbabka@suse.cz, mpe@ellerman.id.au, Palmer Dabbelt , linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel-team@android.com From: Palmer Dabbelt To: akpm@linux-foundation.org, atishp@atishpatra.org X-Stat-Signature: bj46wtaww3oz7n8ohpop7is8kw1epiyy X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 2BA53C0001FE Received-SPF: none (dabbelt.com>: No applicable sender policy available) receiver=imf03; identity=mailfrom; envelope-from=""; helo=mail-pj1-f49.google.com; client-ip=209.85.216.49 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614370698-585775 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: From: Palmer Dabbelt This is only useful under CONFIG_NUMA. IIUC skipping the check is the right thing to do here, as without CONFIG_NUMA there will never be any large node distances on non-NUMA systems. I expected this to manifest as a link failure under (!CONFIG_NUMA && CONFIG_TRANSPARENT_HUGE_PAGES), but I'm not actually seeing that. I think the reference is just getting pruned before it's checked, but I didn't get that from reading the code so I'm worried I'm missing something. Either way, this is necessary to guard the definition of node_reclaim_distance with CONFIG_NUMA. Signed-off-by: Palmer Dabbelt --- mm/khugepaged.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index a7d6cb912b05..b1bf191c3a54 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -819,8 +819,10 @@ static bool khugepaged_scan_abort(int nid) for (i = 0; i < MAX_NUMNODES; i++) { if (!khugepaged_node_load[i]) continue; +#ifdef CONFIG_NUMA if (node_distance(nid, i) > node_reclaim_distance) return true; +#endif } return false; } From patchwork Fri Feb 26 20:17:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 12107321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07416C433E6 for ; Fri, 26 Feb 2021 20:18:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 65DB264F0E for ; Fri, 26 Feb 2021 20:18:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65DB264F0E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B0B026B0005; Fri, 26 Feb 2021 15:18:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A77AC6B0072; Fri, 26 Feb 2021 15:18:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 827006B0005; Fri, 26 Feb 2021 15:18:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0027.hostedemail.com [216.40.44.27]) by kanga.kvack.org (Postfix) with ESMTP id 62ED86B0070 for ; Fri, 26 Feb 2021 15:18:24 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0C42D2C7C for ; Fri, 26 Feb 2021 20:18:24 +0000 (UTC) X-FDA: 77861531328.01.D10360C Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf08.hostedemail.com (Postfix) with ESMTP id C29F780192D4 for ; Fri, 26 Feb 2021 20:18:09 +0000 (UTC) Received: by mail-pl1-f179.google.com with SMTP id e9so5890214plh.3 for ; Fri, 26 Feb 2021 12:18:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding:cc:from:to; bh=9E+CJGi9vbnEQTKM+ByNuYS5mQQ+2hX085/dBrdX5hI=; b=eF0N998zDZscF98K/U6KhV/DH/lPR6SR4RV0yhiLLSA1L1B+bsfUSASoBRA24ZBPxi 9YHsHI7STyER7wx8VXHr+pXZiDyeyEFexER1GjWJpW9+RkC9gc0NEKN9c/TxELvKKb6q N0eUIE3mxU66D/6Z+Qg+Usy0C3OfxqxCusn3UEvtAEEsHMPC9CENxdyNzpLUs/DE1tGL TxwO3xig1gv3gSpLs7K6ZF8XThlVlazBd9QNYEEGElv8KDhjDhNKm22QONS1pJx2MXG3 Ri+tY+LYl1sH8hLOR2txXP0Wvn+8UpgIfTUZIFteH5z1pKqgxRJmdEk3VSS0RJ3Hx1Fy 8dFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=9E+CJGi9vbnEQTKM+ByNuYS5mQQ+2hX085/dBrdX5hI=; b=PmrDpy9CeYGXDZtgp45vB2g/KUeWkbIzdETQPy/s8qiySItVIB8fVCMIiYvpvsHKcY G9r6CrF0EWcdO08IjCVAVeJDaqau0ziyvKImHKpAMjX8a5VbpAMRZmcgNH5O3d32plVt 9aNGgZAOCxxfJImbscxZwKq+LOX05r0VfFUl2kJHWAKe5scdoKzcNG4mXa8x5nnkG6PS qXQnKayNknjGmjvbOPhyMSSv9CQNfpRLDjQKyMP00jSF2scXPIf5dTtvaWZOXcoyYjv8 yHmNNBi+oxdfcO/WXRuy4ZZj279ArlgYqYmNlDWVrLVLG8OM3Rn7Og6oazZ4E2g6tcf/ nOMQ== X-Gm-Message-State: AOAM533GH09yzNbx0mmcltxaH4tFUUsevVYtGuN88f+/tqQfDIUj5jSA UgGbfx9AQF8B12xnIZ39FI3K+L/rrma0PEYs X-Google-Smtp-Source: ABdhPJyMDe4rbtveTYgncBcjGF3qz45nqxfrUYyHXvTYLo0tBDml/VM1sEKxYwUxRH3SrFB4qZpRcw== X-Received: by 2002:a17:90b:1213:: with SMTP id gl19mr5026942pjb.107.1614370701536; Fri, 26 Feb 2021 12:18:21 -0800 (PST) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id e24sm9202856pjr.13.2021.02.26.12.18.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Feb 2021 12:18:21 -0800 (PST) Subject: [PATCH 2/2] topology: Guard node_reclaim_distance with CONFIFG_NUMA Date: Fri, 26 Feb 2021 12:17:21 -0800 Message-Id: <20210226201721.510177-2-palmer@dabbelt.com> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210226201721.510177-1-palmer@dabbelt.com> References: <20210226201721.510177-1-palmer@dabbelt.com> MIME-Version: 1.0 Cc: peterz@infradead.org, srikar@linux.vnet.ibm.com, valentin.schneider@arm.com, vbabka@suse.cz, mpe@ellerman.id.au, Palmer Dabbelt , linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel-team@android.com From: Palmer Dabbelt To: akpm@linux-foundation.org, atishp@atishpatra.org X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C29F780192D4 X-Stat-Signature: mgcgwigq63hfuysqstqg54nzi4jts5wt Received-SPF: none (dabbelt.com>: No applicable sender policy available) receiver=imf08; identity=mailfrom; envelope-from=""; helo=mail-pl1-f179.google.com; client-ip=209.85.214.179 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614370689-723886 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: From: Palmer Dabbelt This is only defined (and useful) for CONFIG_NUMA, but isn't conditionally declared. This makes users a bit more of a headache to track down. Signed-off-by: Palmer Dabbelt --- include/linux/topology.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/topology.h b/include/linux/topology.h index 7634cd737061..15f02281bdf0 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h @@ -73,7 +73,9 @@ int arch_update_cpu_topology(void); * *improves* if allowed to reclaim memory and load balance tasks * between NUMA nodes 2-hops apart. */ +#ifdef CONFIG_NUMA extern int __read_mostly node_reclaim_distance; +#endif #ifndef PENALTY_FOR_NODE_WITH_CPUS #define PENALTY_FOR_NODE_WITH_CPUS (1)