Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1508175ybv; Fri, 14 Feb 2020 00:52:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxSa3cZ+FdF2CGhWLx6AiUrGH4kCdriMKHwKsSfvnA9gNa8fTxDPKc/gx1hF0qp8wfBccpA X-Received: by 2002:a05:6830:1643:: with SMTP id h3mr1368699otr.70.1581670326736; Fri, 14 Feb 2020 00:52:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581670326; cv=none; d=google.com; s=arc-20160816; b=we8ivIF188ZXKU16Rd4L7PN2mS3BvF8nEKHwpHMAOoP+mKqTcbr4mysA6WdiAR4GXc GRzjGm/dp5cDYjm7AXAQ3Y4zK+1YaA1uLm4t0QQz7deRZiw5VeKn4hLPE5bbURVlxCij nUijVaGijq5r9tBTpnGDaELUNbIDoW+KDeVGd04Xo1SH5KO3U4Aua0K8llt1CPd61W+9 GZDFxZKFlju5DZbQzMXLLwlYbTFHb0EY5oTPmLFKjg5BOeUyN//a5VSJ9yLENdyW2N7m SkLf54IomX84Al5uZ2PfIooLMWSfcvSj8tKX/1WbXS4rLY/tIJIvy3X7qXJ0qk8R6Pup WUDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=BiCGDfuoCYPdWxIW1M28/Zsd7aXsuFSeGUo4kNitdWo=; b=rQruUcsKW1YB2c9EeVeEB9NrVLVhvGKLPuIBLBn9RHAeqNIgtihlfJmIUdvwJ0PWV+ VKgO2BdwjS3ZU9skAhAqEtYOGhZTEJS4iB8KVVCl+CCASOk3cd5CZzbNZqlHu/XuGyGH OEw2B5CgdeSeADmaFGcg9If2azFaEk44OwkoZlEnnsZIvcdJ51ecSm2bjY1DllGbFdlS XaFhC1qa8erF7H0QoQX0FdSD800HdKXy86/jQmwsF4b0aSbIlqj1P1u9Q4aHWWl9PRh5 Vz+iu2t2th396VRyZeyomkOi9pxtMrl4iBNLyqOluK3gVjuSCAZ5hwXOJ/be10ILOO/1 XZQw== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9si2170107oij.125.2020.02.14.00.51.54; Fri, 14 Feb 2020 00:52:06 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728895AbgBNIvR (ORCPT + 99 others); Fri, 14 Feb 2020 03:51:17 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40264 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728479AbgBNIvR (ORCPT ); Fri, 14 Feb 2020 03:51:17 -0500 Received: by mail-wr1-f65.google.com with SMTP id t3so9943083wru.7 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=RhupYms3PsvP+sWa+tRS24x/L5K6ZKDy+IYZ7t9e+F5VajtUD+BArhm46zKt0e9gZH 3iv54ypWFuaVN82Gi99uroO4f1j2O+xU36bFJY4UkHxVvOYEbEAp927A/hpff2MwVSdo k7dgUP+9WaHmesl8mXLeqSpXbuWrYMRvtx38dbTFfRdbgiNxyNeYV4TVJTfPxAQNksZz vIBboOkzUTchdXu+1RcPlMMcHqtDFUu/q5393xovWVjtKCgL/pAygnQoYSyouwTQJmJ+ XmQXNlUiDoVPmrgSV4EbK8rt8msh1vJlpzuC0MzzGUSjOoiNn1Ia1VtHm6hzeZYAWJmn WhAw== X-Gm-Message-State: APjAAAULpH6pjIju8lm39ygt11Ed0P6bPRbl+iJPZKOgYBNNjjwjTYBR T9Jt0pExwHO67y4jkguh/Hc= 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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