Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1504931pxb; Fri, 26 Feb 2021 12:30:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyiaZDB12dFDbZHn3gzLHsgK/JEtjfpWaCQRJ6+TbEbwU3p/Fj1M4I5cNOBTjuRp+r9kIEC X-Received: by 2002:a17:906:3881:: with SMTP id q1mr5262447ejd.490.1614371439281; Fri, 26 Feb 2021 12:30:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614371439; cv=none; d=google.com; s=arc-20160816; b=mJ553I0xiNG5s+KsYP02XZrI4VHX4Xh+6qSDR56/nKv/3WHDYa14h+NHay6YjPcIPn /PeQxnF3xf0wDTKmcMsVa4vYeD3bWa5pZKaCjNmaMSpjoA2DWQEl5V6bEVLdIzD0TdWn C5VsjaQGasfYlPGHgGzUzNBjEshQ8y9a1EwC+jOt/cFnCm5AkWOOd64h+F5JtwPVFzQj E9LVRxtlliDlgV4zszHGWn6JOJppr8K/tyyX7WfpgX8PtC0rsK7g7b3/e3TvwHJfQ0Bk OtLb4Pbg/lbkDXzTSC6ZMajAQkHhoLm72idfEmdD5xGZk90uGxm3ftyEWeV/cBzswxX2 BE2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:cc:content-transfer-encoding :mime-version:message-id:date:subject:dkim-signature; bh=FP++fkW38doZ9W2MYsX+Ulsxt6WryiBxofgzcF/5/4U=; b=D/glodl1+ptJc4Oqml9NfAZJJtZ8gvz2uH6NFn0m4Tfs7yaFygz4B7hHyy0K2arQ0t +uv6IyeXY8MMA20MXN6CJy6UDlp6+dyzw5XuhONKN/CHVZmNMl1aXkzYou9yebarjMaA 3tGASTXXmGlH2GkiEV+CDDvomN8qyYoCb3qDTvhpE04EN4bZTJYBF39a2uQm3CboabTp bkD5OVCH3xZLmnyc3WfRi0mTzfoKJQUArCMoZyI/pUjRskhzmfcefm6wBYJKHZcgNKnm i1vvGbG+8hYkegrFPkfsyC+sZ0AWzEStDtWMsYbyfYD28tjf/1lEQUSJVEXO2zce+Vdk Nwlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=Pu588gco; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t21si6743724ejx.435.2021.02.26.12.30.17; Fri, 26 Feb 2021 12:30:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=Pu588gco; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231469AbhBZU2R (ORCPT + 99 others); Fri, 26 Feb 2021 15:28:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230416AbhBZUTA (ORCPT ); Fri, 26 Feb 2021 15:19:00 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9EA6C061756 for ; Fri, 26 Feb 2021 12:18:20 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id i14so5023994pjz.4 for ; Fri, 26 Feb 2021 12:18:20 -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=o1fup9EuOEURuVCs12Pa0WivElx2DIl8I6wU4JOabLdoLtAOsfrf/WLg4jM/Duyalg c5RY/KRAnsuwB48V0umSdonnZNOpmmVDsn153TmOCk0SPhSeDRlbQzkjML77qKioY7ZA mz+EscNscnZXz5ce2jPsaGCum6hhk10GF6uPMaFlFfalFPmcxcEd91cG3MKcc76piAIX xqs+3YgV8zozchanLSMbrucnqLmgfYkivY41W/qmVVBLBVkSo4ejzVtSbBJXojBZ3rNf 6BWq4f1S4KFjfhTg1hm8Qs0PW0eHW3QQZQUxgwLz3Ghw0LQbyGiULz+QLAbsprJsy43H uaHQ== X-Gm-Message-State: AOAM531LXx+8jsA1dYMwdWPS1CBrid3PNyb1SNdnpHyv9yt48jceASvq Pe12nrxPQsFNRkltj6VqMp+rOg== 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 Content-Transfer-Encoding: 8bit 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.30.1.766.gb4fecdf3b7-goog