Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp46336pxu; Tue, 24 Nov 2020 18:09:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxk/lDFtVo6gCsb5svyIedyrHaFnBYMmw5iap0SS6z8mBgJgdTZQ35F70Zbr5uNzVYNyuhr X-Received: by 2002:a17:906:a1cb:: with SMTP id bx11mr1191226ejb.508.1606270146624; Tue, 24 Nov 2020 18:09:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606270146; cv=none; d=google.com; s=arc-20160816; b=zNzAiW4dt2202kIU1X8o5dAm3vHs+kxcfq9S1nKPda+TGLbYOsTZKyvIj9l4Tn3qKo q7oORL7mMvZfFIiiJa2ohLYtD2+yGyV9UqQWXUWAGYZA0KOVC3HWWX8SsnfbbwTNwa1H RXKayT70734ZhoM2QJwSjCZxBM/KJzH9AR1ki27rY6IbB3V3cd1wVdjbOIluX90ydgew b7PuPB5rVtheEakuyHNqumifTbCbd94F8W55EEcjdeCmrRgMCgBP2ers+0+9G4ediGu9 OhUv3OrA716qLwkf0mTd6bbmWKgzGiNUQdUh+Qw/sExbsXp8EAE07rR+7agCsW8vOYA3 DxyQ== 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 :dkim-signature; bh=zLkLMw96ssaB9+5rkk0rS97vQGx/A8O4oddqSfnQLZo=; b=ygAuGMVhWxAOubqYHfXvJsLZAYssd8LNtTY67DF8j/qRR95WEErOU3bkcPtVRnypVS F+Is06G9eCFuDHGF6jp98nuD7N1u5bI5aabCme6zf1eGl6+3cZJQco1OWuEJ0MdBiqCG OlHp47Vwnm49D5fhmMJBJh1DX+Q1OD+AdvDMRnYD9dg0tqJ2dasjil+p5kz5DyZLUQVY JPXwN+50mgszBLgO6jZadf/G7n8649nVdhkxuZztSJy/LS8W3+Il//da4nDsITBehH+q HeUqtYtpnve6w71osJoWdgb1z/jC+UAKR66DVPBz2yWi6g2YZgf2ANxcKZWH9vhJEKWx LGJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YhnhzOvv; 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 a42si408287edf.129.2020.11.24.18.08.43; Tue, 24 Nov 2020 18:09:06 -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; dkim=pass header.i=@kernel.org header.s=default header.b=YhnhzOvv; 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 S2390010AbgKXPv0 (ORCPT + 99 others); Tue, 24 Nov 2020 10:51:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:50926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390003AbgKXPv0 (ORCPT ); Tue, 24 Nov 2020 10:51:26 -0500 Received: from localhost.localdomain (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 26A5F2073C; Tue, 24 Nov 2020 15:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606233085; bh=JWAroebb1HCZItIPh9mrc9nfp/6O6+i/SBzDf+inaQ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YhnhzOvvsJpomNu0T5ASHMnDS7sfnVRR/A4efOtlYFr+Cy5T+OtILRGPnMlo6wZez zS85xtQKOXcJYq+o4K6deKVSoQuvzLCNOCyc78a9ALua/2fYfqIytho+5y1Rpi46eO fiv3c6FEaMIuI4mExATX+8kpX/05B5Qfjiwlq/CU= From: Will Deacon 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 v4 09/14] cpuset: Don't use the cpu_possible_mask as a last resort for cgroup v1 Date: Tue, 24 Nov 2020 15:50:34 +0000 Message-Id: <20201124155039.13804-10-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201124155039.13804-1-will@kernel.org> References: <20201124155039.13804-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.454.gaff20da3a2-goog