Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6328085ybv; Tue, 18 Feb 2020 14:44:53 -0800 (PST) X-Google-Smtp-Source: APXvYqxg7msMXq1VoJ+hPeR19HgF1nrEPyDxSsOG9OoZ5kIA8SrwKafXVFJi6ULr71YtV0ME/Mj5 X-Received: by 2002:a9d:6005:: with SMTP id h5mr18318737otj.153.1582065893590; Tue, 18 Feb 2020 14:44:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582065893; cv=none; d=google.com; s=arc-20160816; b=HKXKPmzbodWedx2zM1wNE1JbL8LewieSJFf9vaOsFZ+vj010b79uGD0P7Wa4rJcSwB RJPRvZVXLRcS7hBwCZRTY98+uuJYaa/BllnOTUEqxzH9CM4ftEZR5CiPErlKtWpMY6Os ENFt942lCHF1LjcbsUOQabcrrVAEwPNLvpuI+DJe+AK+EdwYQjpXZFpsc522MaK3RR9O P952e/+Fh25tzfZL9XcREj61CS76TsYNb3GzLLtDbMxkjVyEbZ+mxdnA9vetAYRbcFkT 4DsbiJV+b+jCqYKcOsIZ+XotiA/FVgnIOhpXRBOKZoNnUnrUXcDWTKiXW+WUaRFX33Jm xqdQ== 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=NirRVlve7aXWzIHxeNW6Nr9dH3pcs6DCO7hgS0Gsyds=; b=AODgyc+q4tmS6D6IkQ/SghmvLbHjSnOPtWTTqZQRiLgzjB15NhJ9fj2Z/XrtiHjo16 FgtQrJfs4EzxeFINVPybGT0+QCRqL2Bn0Y9AeULOWGm+8B0yA7cKynhCuQq+zgQ9FnEc 0fnW7UYwLI92WjjvqzTY2S0e2+zMziSYfFL3omLmwLiyopwVzFl7xTBCtqwXA/OQECN+ xWnMsQVUBLaCF2ypczYQFhIg2o2EYsUDTmlczxmMOfvYM7tx7HitF/TzCFPy7qgnhfI0 Chp3idSmSQVJEbk9jVdgbT4uom13l/E1ufJMqvZX0YI4VisEhT5cYBGW87WtJ2GUZDvH jmdw== 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 r6si78764otp.220.2020.02.18.14.44.40; Tue, 18 Feb 2020 14:44:53 -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 S1726482AbgBRWoG (ORCPT + 99 others); Tue, 18 Feb 2020 17:44:06 -0500 Received: from mga09.intel.com ([134.134.136.24]:23569 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726427AbgBRWoG (ORCPT ); Tue, 18 Feb 2020 17:44:06 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Feb 2020 14:44:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,458,1574150400"; d="scan'208";a="436017418" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga006.fm.intel.com with ESMTP; 18 Feb 2020 14:44:04 -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 v4] mm/vmscan.c: remove cpu online notification for now Date: Wed, 19 Feb 2020 06:44:22 +0800 Message-Id: <20200218224422.3407-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 kswapd kernel thread starts either with a CPU affinity set to the full cpu mask of its target node or without any affinity at all if the node is CPUless. There is a cpu hotplug callback (kswapd_cpu_online) that implements an elaborate way to update this mask when a cpu is onlined. It is not really clear whether there is any actual benefit from this scheme. Completely CPU-less NUMA nodes rarely gain a new CPU during runtime. Drop the code for that reason. If there is a real usecase then we can resurrect and simplify the code. [mhocko@suse.com rewrite changelog] Suggested-by: Michal Hocko Signed-off-by: Wei Yang Acked-by: Michal Hocko --- v4: * adjust changelog suggested by Michal 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