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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 437D9C47078 for ; Fri, 21 May 2021 16:04:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B25561104 for ; Fri, 21 May 2021 16:04:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234139AbhEUQGE (ORCPT ); Fri, 21 May 2021 12:06:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbhEUQGC (ORCPT ); Fri, 21 May 2021 12:06:02 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 264B8C061574; Fri, 21 May 2021 09:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rOUSMzUazFVWTtdtGXWIZ9Ml1r75lqXoNz586zbgxOE=; b=nNRqUIHd25G1YFdETP5KXvxo6m 5UQvVEciIApRzCglIzquESH/jC97Kr9NVZNfUWodXMc0XYBhYYrSBZK29fE3tH5VFXKXGyQJZ1juI ryVsHOxYFrH5q7LISOk3/00iqTR6hq/Q3cgCBzjzpzCgY9j7TeaNk1LM+DGNRlTqA6UJffy8w7T0B +ee/iyr//K8+EcY5cIcWU3DldmkaGWfm3mjEvXVZyPnuQ8L6QFiVHgUlDFxen1TeeeJulIIY3ohqt 5ZQcHdEVSR+Ww2IGDuMCmEOxKR4/dGyVJCrik7zYMcX+SyWOGC8sRZ6WO5/FY4HJn9QNWg1U5C3Xs QYVuzQRw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lk7co-0003fs-5O; Fri, 21 May 2021 16:03:49 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id D90FE981F05; Fri, 21 May 2021 18:03:44 +0200 (CEST) Date: Fri, 21 May 2021 18:03:44 +0200 From: Peter Zijlstra 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 , 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: <20210521160344.GJ5618@worktop.programming.kicks-ass.net> References: <20210518094725.7701-1-will@kernel.org> <20210518094725.7701-7-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210518094725.7701-7-will@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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 EA342C47078 for ; Fri, 21 May 2021 16:05:31 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 A172561104 for ; Fri, 21 May 2021 16:05:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A172561104 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.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=desiato.20200630; 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=n24f6XKX1+dUK71Nyz62qiMqkIh4fwdJgJeudliqgtU=; b=cn3d7j90dMgUjUdkjQTwzYu1w2 FbybV0Dn6SLvATm2LF/PNy5cuOAU6DUbiVoogdIyNneSH57F6WamN8PJziohJGiyYpIucTJV2hmeX 7srHMGDsrPgT+YBcl4C4aCVxSDPKVf+YE1oq5k9TlVYojxwV8TVYWGiEbFFPUz+YiS6W3eMsmAZso a+aEZn6xD6BCL9bEs9LtqPXTRpFgaXPdKB/sjiSQy90+x9r5ff7H+y3iZ5HLt7zmNbXTUcDgNWUSK QhCs6dCsJbeVpGz1hLJgjxBoNzNeOTb/G5rU2E8JTasdrvY3mnDCBtIqccsTGxlDwm6Aau5SaLk7B 93TvzzfQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk7d7-000AoN-S1; Fri, 21 May 2021 16:04:06 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk7d3-000Anu-Uo for linux-arm-kernel@desiato.infradead.org; Fri, 21 May 2021 16:04:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rOUSMzUazFVWTtdtGXWIZ9Ml1r75lqXoNz586zbgxOE=; b=nNRqUIHd25G1YFdETP5KXvxo6m 5UQvVEciIApRzCglIzquESH/jC97Kr9NVZNfUWodXMc0XYBhYYrSBZK29fE3tH5VFXKXGyQJZ1juI ryVsHOxYFrH5q7LISOk3/00iqTR6hq/Q3cgCBzjzpzCgY9j7TeaNk1LM+DGNRlTqA6UJffy8w7T0B +ee/iyr//K8+EcY5cIcWU3DldmkaGWfm3mjEvXVZyPnuQ8L6QFiVHgUlDFxen1TeeeJulIIY3ohqt 5ZQcHdEVSR+Ww2IGDuMCmEOxKR4/dGyVJCrik7zYMcX+SyWOGC8sRZ6WO5/FY4HJn9QNWg1U5C3Xs QYVuzQRw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lk7co-0003fs-5O; Fri, 21 May 2021 16:03:49 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id D90FE981F05; Fri, 21 May 2021 18:03:44 +0200 (CEST) Date: Fri, 21 May 2021 18:03:44 +0200 From: Peter Zijlstra 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 , 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: <20210521160344.GJ5618@worktop.programming.kicks-ass.net> References: <20210518094725.7701-1-will@kernel.org> <20210518094725.7701-7-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210518094725.7701-7-will@kernel.org> 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 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? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel