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=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 641B4C4743C for ; Fri, 4 Jun 2021 17:13:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 28F9B61359 for ; Fri, 4 Jun 2021 17:13:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 28F9B61359 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RM4Cp4P8fIQ1Sp+N7NxJ9/nJE7iKI9pdTiK4myQ/ScU=; b=h/iGG0d+6rz7WC 7m+uNEkxZpexWRtlFmdeeK3pZRkoVrdBQ5ZtrVMzg8RYrfI27JK2j2pSUlrGCpNWn4GBFWP918wd0 aTH788/PPGpUmubg0ei47ZgIo6HuueLrJG3wiW7s+t4BBCsZYGhWFh3SKMxFLQNIQnVfsWT9JdCWY pGGI19ADG+9QIuV/kzAuLXhch1kFUdqMqejswDMVLWbfi3q+DLjQzVFWON7hispxzzOr17/ilge2e UmRpTnr0GwEsEeI224+MhVNjNEd6qQoNPhaT0fgzhc8gFK9gkcrBpI16LM0QZENtZdjJbbNdTlBjq yhOIfuOIr7cFMSIBgezg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpDLp-00EYBk-Ie; Fri, 04 Jun 2021 17:11:17 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpDLh-00EY81-I1 for linux-arm-kernel@lists.infradead.org; Fri, 04 Jun 2021 17:11:10 +0000 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 A0A081063; Fri, 4 Jun 2021 10:11:08 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CBB5E3F73D; Fri, 4 Jun 2021 10:11:05 -0700 (PDT) From: Valentin Schneider To: Will Deacon , 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 , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , "Rafael J. Wysocki" , Dietmar Eggemann , Daniel Bristot de Oliveira , kernel-team@android.com, Li Zefan Subject: Re: [PATCH v8 06/19] cpuset: Don't use the cpu_possible_mask as a last resort for cgroup v1 In-Reply-To: <20210602164719.31777-7-will@kernel.org> References: <20210602164719.31777-1-will@kernel.org> <20210602164719.31777-7-will@kernel.org> Date: Fri, 04 Jun 2021 18:11:03 +0100 Message-ID: <877dj9ees8.mognet@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210604_101109_709231_A471FF2A X-CRM114-Status: UNSURE ( 9.01 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 02/06/21 17:47, Will Deacon wrote: > @@ -3322,9 +3322,13 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) > > void cpuset_cpus_allowed_fallback(struct task_struct *tsk) > { > + const struct cpumask *cs_mask; > + const struct cpumask *possible_mask = task_cpu_possible_mask(tsk); > + > rcu_read_lock(); > - do_set_cpus_allowed(tsk, is_in_v2_mode() ? > - task_cs(tsk)->cpus_allowed : cpu_possible_mask); > + cs_mask = task_cs(tsk)->cpus_allowed; > + if (is_in_v2_mode() && cpumask_subset(cs_mask, possible_mask)) > + do_set_cpus_allowed(tsk, cs_mask); Since the task will still go through the is_cpu_allowed() loop in select_fallback_rq() after this, is the subset check actually required here? It would have more merit if cpuset_cpus_allowed_fallback() returned whether it actually changed the allowed mask or not, in which case we could branch either to the is_cpu_allowed() loop (as we do unconditionally now), or to the 'state == possible' switch case. > rcu_read_unlock(); > > /* > -- > 2.32.0.rc0.204.g9fa02ecfa5-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel