Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1354656pxu; Fri, 27 Nov 2020 05:36:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKyWD8PL7jOoT0H/rhxo32HuUeN+DH2PhkYHf9CdPj046vrtzkr2y7Sw1pwdHf/by4gfKw X-Received: by 2002:a17:906:914d:: with SMTP id y13mr7766018ejw.45.1606484162743; Fri, 27 Nov 2020 05:36:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606484162; cv=none; d=google.com; s=arc-20160816; b=QzPd90RExNNNaeQC5FEt8zLI4nVPFcS9W95qM0pwNLfELGoSVYKZKlecIjM5n7MOc8 kEzNa3wPBZxvKZvE5JwK4IE63IPEqTON52gFvBzXSqVyg7Ex1v/n8EKn4b8KqYcFechM Nz0xvKfvUx5mNAEV0Rq+kGkn8goJYofzrDgJhyHXM49e84pAv7mvb8q5LhHkMQH13zBi /Uan3RWqFaeS0XEj/3Qka5wOnLgzjsv0ZxmvOii4bZLYkYzaLh6vux9IocHJ3hifS6gx 2rCuIMbIOQN+wN4Jw3a0mAckh4mR+nZZOqA6t2qHSaVDBgR2WwSWXw4Pp5pfJ3g8pTcI vPCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=edsFyg4IU/oWe3ylRyzjjNYhImbvK798as0rT1m13QE=; b=FW4uIOpt0jnHD2snBURilb0FQiJLG9T8b3xOBv/GQzhVGTcrK/njS1/+X9UZBOPtZh QEB8f1qGlyAziqaA5ErJ/KDfx+ewkaNCS5YPVtQiuGYqZoj77aQo2DcNHCW1vtopq+3y NAL1QS7fzf5tHVzeRhGZwZvb1oskGbm3a/eptUrWPo6AcnogbKwJ92/XAb/RYl72d5Is owRABLotnKpj+MkJo1uu58DYf8FBHPChVddcKuJhuTyuDZ31Z3znXccwAyyk0H6sxfQw t7n1hVBsW0R0X56XdU7X944D6ZSpXHbl71gocfBmMBSAFy1QHTbITm84ZzMZciN/t2SC 9VWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w6si5296049edj.604.2020.11.27.05.35.40; Fri, 27 Nov 2020 05:36:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729762AbgK0Ncv (ORCPT + 99 others); Fri, 27 Nov 2020 08:32:51 -0500 Received: from foss.arm.com ([217.140.110.172]:41950 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729169AbgK0Ncu (ORCPT ); Fri, 27 Nov 2020 08:32:50 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 29F1F31B; Fri, 27 Nov 2020 05:32:50 -0800 (PST) Received: from e107158-lin.cambridge.arm.com (unknown [10.1.194.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ED1A43F70D; Fri, 27 Nov 2020 05:32:47 -0800 (PST) Date: Fri, 27 Nov 2020 13:32:45 +0000 From: Qais Yousef To: Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Catalin Marinas , Marc Zyngier , Greg Kroah-Hartman , Peter Zijlstra , Morten Rasmussen , Suren Baghdasaryan , Quentin Perret , Tejun Heo , Li Zefan , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , kernel-team@android.com Subject: Re: [PATCH v4 09/14] cpuset: Don't use the cpu_possible_mask as a last resort for cgroup v1 Message-ID: <20201127133245.4hbx65mo3zinawvo@e107158-lin.cambridge.arm.com> References: <20201124155039.13804-1-will@kernel.org> <20201124155039.13804-10-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201124155039.13804-10-will@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/24/20 15:50, Will Deacon wrote: > If the scheduler cannot find an allowed CPU for a task, > cpuset_cpus_allowed_fallback() will widen the affinity to cpu_possible_mask > if cgroup v1 is in use. > > In preparation for allowing architectures to provide their own fallback > mask, just return early if we're not using cgroup v2 and allow > select_fallback_rq() to figure out the mask by itself. What about cpuset_attach()? When a task attaches to a new group its affinity could be reset to possible_cpu_mask if it moves to top_cpuset or the intersection of effective_cpus & cpu_online_mask. Probably handled with later patches. /me continue to look at the rest Okay so in patch 11 we make set_cpus_allowed_ptr() fail. cpuset_attach will just do WARN_ON_ONCE() and carry on. I think we can fix that by making sure cpuset_can_attach() will fail. Which can be done by fixing task_can_attach() to take into account the new arch task_cpu_possible_mask()? Thanks -- Qais Yousef > > Cc: Li Zefan > Cc: Tejun Heo > Cc: Johannes Weiner > Reviewed-by: Quentin Perret > Signed-off-by: Will Deacon > --- > kernel/cgroup/cpuset.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index 57b5b5d0a5fd..e970737c3ed2 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -3299,9 +3299,11 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) > > void cpuset_cpus_allowed_fallback(struct task_struct *tsk) > { > + if (!is_in_v2_mode()) > + return; /* select_fallback_rq will try harder */ > + > rcu_read_lock(); > - do_set_cpus_allowed(tsk, is_in_v2_mode() ? > - task_cs(tsk)->cpus_allowed : cpu_possible_mask); > + do_set_cpus_allowed(tsk, task_cs(tsk)->cpus_allowed); > rcu_read_unlock(); > > /* > -- > 2.29.2.454.gaff20da3a2-goog >