Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5290108ybv; Mon, 17 Feb 2020 16:46:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzAoJZzb/Di2bCNgZQm7NAEJVQNfuH1ds9+NO/nlquIPlyGiXwS4wrwXJ9dILxBPGBWkRKW X-Received: by 2002:a05:6830:1d91:: with SMTP id y17mr13418466oti.276.1581986777356; Mon, 17 Feb 2020 16:46:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581986777; cv=none; d=google.com; s=arc-20160816; b=pLt+xmLwWMyFi2GdXiO3J8pgH1/c5B/jokgdme2WiRTvJEbx13yVGFmFYvqLko2Kwf QSi5NrwpV1OEngTqRl/bm+dgCaLzAaSu5ukFUxs7dI2+1nLCY9+szzpY9AkeJ+3muhmL zcrAlC2PGD/cax16CATW561ffl1znYHT8uPEw017l/kUfwZQz2MfN1kncgBKObJ681yO +shgCreCod0/ovk6peypikyK5FNs9g3prctRvS65rNu36uNoJ3fF7GCJSw/Jh3oefbDR lFgrsSQzSgLDeN3ZOpc22VQ2IssZsQkg9ZC3LqeQqs5rFIAGK1bMCYQUmYiUsz+sxgJb rE/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=4082u1ggwFfXkkMsxWFFGGeNtgYcV6yt5aLBIZqMW44=; b=ekAe3OXZdj4xi9YL6ScQS+bPibFCY8y/tNritP+MirY0g6iY07iTt45eteZgBf5axw HzUHhHYTtvv4aImGrIAfklbUUwcMMntliq7wsn5Ryd/PwFZa2jp89W0Pwl9gk+9f4iQK c25WycVLSBC8qPgyIBdatLkrVCP3FhoXmpR2tPwA5LFcxc0f/2KING2WYFxPcnU1+bL3 sCb2R14imY3cmyoAVtF2NROHuMbbLyFsumZsOGulHlYkOkLw1OMTw38PMRajYuislDSa XKxvUApqGt7rhemxvVxWOKEf5vggEW9QGh6FXTXXBPJqf0fn0tLZndZEeMqqmu8F2Nl7 /8FQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v7si7379246oic.208.2020.02.17.16.46.04; Mon, 17 Feb 2020 16:46:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726276AbgBRAoq (ORCPT + 99 others); Mon, 17 Feb 2020 19:44:46 -0500 Received: from mga09.intel.com ([134.134.136.24]:22740 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbgBRAop (ORCPT ); Mon, 17 Feb 2020 19:44:45 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Feb 2020 16:44:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,454,1574150400"; d="scan'208";a="229327225" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga008.fm.intel.com with ESMTP; 17 Feb 2020 16:44:43 -0800 From: Wei Yang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, rientjes@google.com, mhocko@kernel.org, Wei Yang Subject: [PATCH] mm/vmscan.c: remove cpu online notification for now Date: Tue, 18 Feb 2020 08:43:54 +0800 Message-Id: <20200218004354.24996-1-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The cpu online notification is used to adjust kswapd cpu affinity when a NUMA node gains a new CPU. Since currently we don't see a real runtime configuration like this, let's drop this online notification for now. Suggested-by: Michal Hocko Signed-off-by: Wei Yang --- v3: * remove the cpu online notification suggested by Michal v2: * rephrase the changelog --- mm/vmscan.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 665f33258cd7..a4fdf3dc8887 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4023,27 +4023,6 @@ unsigned long shrink_all_memory(unsigned long nr_to_reclaim) } #endif /* CONFIG_HIBERNATION */ -/* It's optimal to keep kswapds on the same CPUs as their memory, but - not required for correctness. So if the last cpu in a node goes - away, we get changed to run anywhere: as the first one comes back, - restore their cpu bindings. */ -static int kswapd_cpu_online(unsigned int cpu) -{ - int nid; - - for_each_node_state(nid, N_MEMORY) { - pg_data_t *pgdat = NODE_DATA(nid); - const struct cpumask *mask; - - mask = cpumask_of_node(pgdat->node_id); - - if (cpumask_any_and(cpu_online_mask, mask) < nr_cpu_ids) - /* One of our CPUs online: restore mask */ - set_cpus_allowed_ptr(pgdat->kswapd, mask); - } - return 0; -} - /* * This kswapd start function will be called by init and node-hot-add. * On node-hot-add, kswapd will moved to proper cpus if cpus are hot-added. @@ -4083,15 +4062,11 @@ void kswapd_stop(int nid) static int __init kswapd_init(void) { - int nid, ret; + int nid; swap_setup(); for_each_node_state(nid, N_MEMORY) kswapd_run(nid); - ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, - "mm/vmscan:online", kswapd_cpu_online, - NULL); - WARN_ON(ret < 0); return 0; } -- 2.17.1