Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3172548pxu; Tue, 8 Dec 2020 05:33:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+XMhaInb9IkWKq+M90Q3o6uHl9AZeaw+J4bdxjxqCG8jZyLr/62sRsEXEedEw6+ZwQoak X-Received: by 2002:a05:6402:1d3b:: with SMTP id dh27mr17833255edb.238.1607434396113; Tue, 08 Dec 2020 05:33:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607434396; cv=none; d=google.com; s=arc-20160816; b=cot2zt55QwE7oU568wOGcn08zrlwKanBVWTxeVUkLfspFCyGsAGQhrCAIdK9hZv4r9 Sy2+CNX1m3gna4isaSoWQc5Ki9QtmUXd4K9sS38zlGV2RCXKC6CsKeQ6DnDZvfIYzjPX g8GU1NX7UMH3DC/RoT4KUhLFIa4fIzEcA3ooue4BDmLbEMcyrKX16ySAvUZKE6HtRfjg vueoh0thiaxoZrUgHdWl5omOr6OklwuaRksL+wW21Uk4VEJDUzFuiwwsM+MqwYSMq4YB D8C8pySgxeNu3CwGHMa0/1O795n2bVoO/jiyxgtIJGY2WHGd5ODdiWDhUSOPCmJjNtEE 0lyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=7g5JGS3Pn7HPA/iyXzH0ojBC4NuFa3cAu6O7ebSd+Y0=; b=N7iXa0bveErMmHIB8I55jCdFLrIszoKiyjGVmgAVCBOjJKM/h9W/9pEy4zi61dia/L 2cetlif0eqDi973xilzW39fAOHSrTxXd9Gw3aaUY0tBgmyo4O82ufTAdnfCMFcMxD5iR Hnhk07NgVmwPjnJ9lL5S8d1V6QO5UiB5MVQxun8AcQzt4QKrB70D1fo0qGZiJvtF3Jw5 jpTH8qyU1lJRQEIg3jGc37hdeHkAxBdAqKza/miAXi3ELOipBIS8WeW/4lBC3IuCeLDo i6TRNLNv3jabr1O7D3nbACGs7Z372eMs9i0kFcWKFHeL2zH9Xt0Kmt+zZYvCmSv/SLfD pJww== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d13si10284777edu.534.2020.12.08.05.32.53; Tue, 08 Dec 2020 05:33:16 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729428AbgLHNaO (ORCPT + 99 others); Tue, 8 Dec 2020 08:30:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:49188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728786AbgLHNaO (ORCPT ); Tue, 8 Dec 2020 08:30:14 -0500 From: Will Deacon Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-arm-kernel@lists.infradead.org Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Will Deacon , Catalin Marinas , Marc Zyngier , Greg Kroah-Hartman , Peter Zijlstra , Morten Rasmussen , Qais Yousef , Suren Baghdasaryan , Quentin Perret , Tejun Heo , Li Zefan , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , kernel-team@android.com Subject: [PATCH v5 07/15] cpuset: Don't use the cpu_possible_mask as a last resort for cgroup v1 Date: Tue, 8 Dec 2020 13:28:27 +0000 Message-Id: <20201208132835.6151-8-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201208132835.6151-1-will@kernel.org> References: <20201208132835.6151-1-will@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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.576.ga3fc446d84-goog