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=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 AF2F5C04FF3 for ; Mon, 24 May 2021 21:48:26 +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 7980C61284 for ; Mon, 24 May 2021 21:48:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7980C61284 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NGqZv69FsuIEpMimdV2YMF4gdElzqW6aM/5TOsqglc8=; b=QSTTwxzMSuQbYX s+o4QMV+awuZo0cDOpqTMAl0M+zHkipMowCW3c2yAN5xPf4XUp2X0tgSAJSyRBxVa4YV4UTUgJBf+ sHI9OFJDob+LrLCSX5XhLyvVYKqgwP8SiRlgzZ7LnzB/6RopzF2O0zDztzYbOQkMSK2CD3wkt3csQ EJ8Y8UEOry/ZZt239h1+bSCEUTMal1FUwWpIw09xfvkbc7CcXN4ztHTe/9D+FU8FR0Nb4EbOWUeTB UGqSZhXCI0YvNwWmXIwuaLpyc2b92+m5CfKFJBlZiyYrZzQMZkMtlft4gJuYR/8wXlGR/dLEipIOZ /GrNWT1Z+nUkgVOlvVyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1llIOV-001zJ9-L3; Mon, 24 May 2021 21:45:53 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ll9Wo-000uNM-JM for linux-arm-kernel@lists.infradead.org; Mon, 24 May 2021 12:17:51 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id E9C6261209; Mon, 24 May 2021 12:17:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621858669; bh=teXbnvQA/9F8le8shlLhKROaQfKBflKP12itvlr6NDM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=n9EzFsn5dgbYafkGAnH83DXTFT9rXqgvD6woQxgp/zRM42lpntgjsNnJ9EBz0pe/I XZjedXwXuS7lp6oLxvheJqEThhwQInWq+dDnTYVC0iiLPrXEwCqrwJao6eq2cSz3z6 1Yi1rlh8b7hWw9gD5LGJ8/Y8D+V39pA8fL2SI4VCV71zwKHlze5995dCCMpiurWsg+ kKr8iswfH1CbKIXn3uvejF8r1k+/8KP21/JqDZ0sOb6bmFXn2GKr7NtwoptdURx+Vp w5JM2OYBfaOmHTafGekf7wiN48UGOizAmsReN5yotDsYLv4mCFfnMQ/JSqQjI4ULc5 7uo1w5mMC3n2g== Date: Mon, 24 May 2021 13:17:43 +0100 From: Will Deacon To: Peter Zijlstra Cc: linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Catalin Marinas , Marc Zyngier , Greg Kroah-Hartman , Morten Rasmussen , Qais Yousef , Suren Baghdasaryan , Quentin Perret , Tejun Heo , Li Zefan , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , "Rafael J. Wysocki" , kernel-team@android.com Subject: Re: [PATCH v6 06/21] sched: Introduce task_cpu_possible_mask() to limit fallback rq selection Message-ID: <20210524121743.GC14913@willie-the-truck> References: <20210518094725.7701-1-will@kernel.org> <20210518094725.7701-7-will@kernel.org> <20210521160344.GJ5618@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210521160344.GJ5618@worktop.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210524_051750_687536_64EC391A X-CRM114-Status: GOOD ( 19.95 ) 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 Fri, May 21, 2021 at 06:03:44PM +0200, Peter Zijlstra wrote: > On Tue, May 18, 2021 at 10:47:10AM +0100, Will Deacon wrote: > > diff --git a/include/linux/mmu_context.h b/include/linux/mmu_context.h > > index 03dee12d2b61..bc4ac3c525e6 100644 > > --- a/include/linux/mmu_context.h > > +++ b/include/linux/mmu_context.h > > @@ -14,4 +14,12 @@ > > static inline void leave_mm(int cpu) { } > > #endif > > > > +/* > > + * CPUs that are capable of running task @p. By default, we assume a sane, > > + * homogeneous system. Must contain at least one active CPU. > > + */ > > +#ifndef task_cpu_possible_mask > > +# define task_cpu_possible_mask(p) cpu_possible_mask > > +#endif > > #ifndef task_cpu_possible_mask > # define task_cpu_possible_mask(p) cpu_possible_mask > # define task_cpu_possible(cpu, p) true > #else > # define task_cpu_possible(cpu, p) cpumask_test_cpu((cpu), task_cpu_possible_mask(p)) > #endif > > > + > > #endif > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > index 5226cc26a095..482f7fdca0e8 100644 > > --- a/kernel/sched/core.c > > +++ b/kernel/sched/core.c > > @@ -1813,8 +1813,11 @@ static inline bool is_cpu_allowed(struct task_struct *p, int cpu) > > return cpu_online(cpu); > > > > /* Non kernel threads are not allowed during either online or offline. */ > > if (!(p->flags & PF_KTHREAD)) > > - return cpu_active(cpu); > + return cpu_active(cpu) && task_cpu_possible(cpu, p); > > > /* KTHREAD_IS_PER_CPU is always allowed. */ > > if (kthread_is_per_cpu(p)) > > Would something like that make sense? I think this is probably the only place that we could use the helper, but it's also one of the places where architectures that don't have to worry about asymmetry end up with the check so, yes, I'll do that for v7. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel