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=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 84B4BC3B195 for ; Fri, 14 Feb 2020 08:51:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 52977222C4 for ; Fri, 14 Feb 2020 08:51:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52977222C4 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 EE25F6B060A; Fri, 14 Feb 2020 03:51:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E928C6B060B; Fri, 14 Feb 2020 03:51:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA8796B060C; Fri, 14 Feb 2020 03:51:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0161.hostedemail.com [216.40.44.161]) by kanga.kvack.org (Postfix) with ESMTP id BF7D16B060A for ; Fri, 14 Feb 2020 03:51:16 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5AEEE40D6 for ; Fri, 14 Feb 2020 08:51:16 +0000 (UTC) X-FDA: 76488113352.18.shelf91_282b5d48bca18 X-HE-Tag: shelf91_282b5d48bca18 X-Filterd-Recvd-Size: 3541 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Fri, 14 Feb 2020 08:51:15 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id y11so9938375wrt.6 for ; Fri, 14 Feb 2020 00:51:15 -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=BiCGDfuoCYPdWxIW1M28/Zsd7aXsuFSeGUo4kNitdWo=; b=dgNZOA5esNjjcxgY8LjxRRtCCIWnSZi6Z1mZQsK7PXPXMeV8WgfrhYiX2XeAY49BrB YOAKB4sNEkJ1XRndyVLExr4kx7ndC/sj6Q5HnjKc/js0P5diDa2+dOh0ZOP5mOe2uKHw 7XaVjVXxmpyLDEQF2aAUsRfHFM0fYPuLxMVTytLw3aodh/C6J4OV8rvBHSYhO8XQY40H tzULp+VK5AyDqzBWNWUXNuZhosPtevyDvpFXY5RgZtu5ThmceXOXlK5R2xeEpS8SveqO oh9zTLHJiqlgF5OXvZ83cRymsV6IfQX4wVK3mDIMAqkcfn6DlUNptyjONDJ3fmnqGU1i aTUQ== X-Gm-Message-State: APjAAAXo2Q8ZU/suZCwEsJfZsozW8S1dgUk+ajll2bYnAn7ewohjm0zj 9kUuQRSMAn+bX6l8sQvMYnrtoAf3 X-Google-Smtp-Source: APXvYqzA8BgS5lHJJKqW69RsyTfykS+05eBAPXPTD5F3L1+d5ysjIYwBC/SDzJEN0tbseTPBZzm0Xg== X-Received: by 2002:adf:9427:: with SMTP id 36mr2937924wrq.166.1581670275077; Fri, 14 Feb 2020 00:51:15 -0800 (PST) Received: from localhost (ip-37-188-133-87.eurotel.cz. [37.188.133.87]) by smtp.gmail.com with ESMTPSA id d22sm6323540wmd.39.2020.02.14.00.51.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 00:51:14 -0800 (PST) Date: Fri, 14 Feb 2020 09:51:13 +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 v2] mm/vmscan.c: only adjust related kswapd cpu affinity when online cpu Message-ID: <20200214085113.GP31689@dhcp22.suse.cz> References: <20200214073320.28735-1-richardw.yang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200214073320.28735-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 Fri 14-02-20 15:33:20, Wei Yang wrote: > When onlining a cpu, kswapd_cpu_online() is called to adjust kswapd cpu > affinity. > > Current routine does like this: > > a) Iterate all the numa node > b) Adjust cpu affinity when node has an online cpu > > For a) this is not necessary, since the particular online cpu belongs to > a particular numa node. So it is not necessary to iterate on every nodes > on the system. This new onlined cpu just affect kswapd cpu affinity of > this particular node. > > For b) several cpumask operation is used to check whether the node has > an online CPU. Since at this point we are sure one of our CPU onlined, > we can set the cpu affinity directly to current cpumask_of_node(). > > This patch simplifies the logic by set cpu affinity of the affected > kswapd. How have you tested this patch? Also this is an old code and quite convoluted but does it still work as inteded? I mean, I do not see any cpu offline callback to reduce the cpu mask as all the CPUs for the given node go offline? Wouldn't the scheduler simply go and fallback to no affinity if that happens? In other words what is the value of kswapd_cpu_online in the first place? -- Michal Hocko SUSE Labs