From mboxrd@z Thu Jan 1 00:00:00 1970 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=-7.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 B1764C34026 for ; Tue, 18 Feb 2020 08:40:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7846C2176D for ; Tue, 18 Feb 2020 08:40:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7846C2176D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0EFF36B0003; Tue, 18 Feb 2020 03:40:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0A06E6B0006; Tue, 18 Feb 2020 03:40:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED1A16B0007; Tue, 18 Feb 2020 03:40:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0035.hostedemail.com [216.40.44.35]) by kanga.kvack.org (Postfix) with ESMTP id D259E6B0003 for ; Tue, 18 Feb 2020 03:40:26 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 606AD181AEF1F for ; Tue, 18 Feb 2020 08:40:26 +0000 (UTC) X-FDA: 76502601252.06.sun26_20e1d10849b60 X-HE-Tag: sun26_20e1d10849b60 X-Filterd-Recvd-Size: 5122 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Tue, 18 Feb 2020 08:40:25 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id g1so1833378wmh.4 for ; Tue, 18 Feb 2020 00:40:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=y4L4vqax5DXxcdwoLUSziZL4YzCsONFZYcUjD/fBwIc=; b=ovze62uswBPRTLHsxY3YpXRYtZPkNVZM3XyuvfIm+/2PGvsZtL9NqilOKNktTYa3Kg Pz0UJlJLsEVWs3XhGU6PKczXyNDL9d3dovAZCkTw0B3y6bD/XFKoGj7ln/P+CwFIp368 APVm0vsQg5Kh0eWIGyz2IrG2shjuL/vwhAuXwxD7ktZED4etWOHk4vOCrddnYKX4djbq 72fqGxzsajgk+AuwNS9rLXQD9WHBFVJOi9kDNZM3DWiY+zsvo5Lxdy7213r7xhy2MaOI G2Xpx4+b5xEVqgON3oXgEOXOx09gNHcHeUVWQuYHxbMjUyUNZ4gwVBfzjdnZCXXrPUtJ J2uA== X-Gm-Message-State: APjAAAXs6LQIf6Ft4JApybT5D6/hEQIQTNHnL1D+EIUHpvQ22mIAvTGK tRz7uLY8kDi5GYsVsqPBSpg= X-Google-Smtp-Source: APXvYqxQfED5fW8dxHW4UDTLGMrMLYVewY3D9xMIFdmBIm3GJmBYc8X91w7MFeF+Z293Qv4cTcFiBA== X-Received: by 2002:a7b:cc81:: with SMTP id p1mr1782467wma.62.1582015224739; Tue, 18 Feb 2020 00:40:24 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id r1sm5026822wrx.11.2020.02.18.00.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 00:40:23 -0800 (PST) Date: Tue, 18 Feb 2020 09:40:23 +0100 From: Michal Hocko To: Wei Yang Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, rientjes@google.com Subject: Re: [PATCH] mm/vmscan.c: remove cpu online notification for now Message-ID: <20200218084023.GC21113@dhcp22.suse.cz> References: <20200218004354.24996-1-richardw.yang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200218004354.24996-1-richardw.yang@linux.intel.com> 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: On Tue 18-02-20 08:43:54, Wei Yang wrote: > 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. This deserves much more explanation IMHO. What would you say about the following. " 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. " > > Suggested-by: Michal Hocko > Signed-off-by: Wei Yang Acked-by: Michal Hocko > > --- > 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 -- Michal Hocko SUSE Labs