Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1033718rdb; Fri, 20 Oct 2023 06:49:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdUI6Pyb0+q6OYrkgHZcycOuQ8LN81Ptt8EwsF6IzPvxh3jNwAET8vsu4hde1+6QS+Is2c X-Received: by 2002:a17:903:110e:b0:1c4:72c9:64fc with SMTP id n14-20020a170903110e00b001c472c964fcmr2275816plh.22.1697809744777; Fri, 20 Oct 2023 06:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697809744; cv=none; d=google.com; s=arc-20160816; b=A4t7RJxz+uajwd5xnTMmkg0ymZnANjz9fSrkYQGs9kBxU2XlpG9IwU7qaZDMBuKtOa RkROzfRx9ZtxYpqQGyifZhQpda5np6mPv/YtBPH+RBs/HHtoBt8FiyWky2skoe03BmzZ TviiddOHV8GIINSIYphLUu4qXo0cHwGERnPPR4CmQEe9t7BRP5caY4wvl02SfD0EdQlg fWahrPry4CAH80e2gUhKdc3wEaU6yOn1/xqyhZF9Xxp9iIHiSXHAIf6TwSUoxSmKRBIB 3TYHHb7hFV+rIqfp7ELK4qwnxZ+Abep8LDW5BfKlDunYKY44hKuDMc76o4M0jAeXBUVv e83g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zpdQvX62vrGzB5mMaNjp6jXA2kzttVSPTh1BbmBsa6U=; fh=zYR2AE+XKWIrD30o7Oj+yIXT1YcRNz/t9SjPV85E+Pw=; b=umSFTwoX7miMq2FNVwnVbCi3+5TPCWE2+7FY0ONgWk/vF8Jiobgp4AmXxWfVn+dkJK JZyGUUKfE7coXUeFsnWuZjBUuNYjopyQfWlt0sv3YylJKrBTfSfxv2qhJEc5XqiGuGS/ EgsqqseacmmW81ezVLh8TvK7QCsIpNoGtbN74GnMQQiCLYsm+lxo6Rb/fBPw+yMYXcfZ t9VHBOKuUht6ccPRCggnvvWeLwMkHwDpDY26dhWqLV/tbFe5o0q43xqvr2G6haZ0RFB/ XZGcSG3Z0W+8Zzfu94fqAqcpr83wisT0QZTwUQzeqLOLdQaZbBGmdCdF3ykJOdMvr04N vCEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=DkBUNzQj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id k4-20020a170902d58400b001b8a56b9895si1857018plh.616.2023.10.20.06.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 06:49:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=DkBUNzQj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5F14D82F34A7; Fri, 20 Oct 2023 06:49:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377482AbjJTNtB (ORCPT + 99 others); Fri, 20 Oct 2023 09:49:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377497AbjJTNs4 (ORCPT ); Fri, 20 Oct 2023 09:48:56 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0B4C1BF; Fri, 20 Oct 2023 06:48:54 -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=zpdQvX62vrGzB5mMaNjp6jXA2kzttVSPTh1BbmBsa6U=; b=DkBUNzQj4oRMt4w9BQGLe2yWqj GsuLmxMoir9nlzUFyNVeTbe5BM9K8Pqpz/kWLx6E1Dm4al+VCP+HCP2IoY9w7tPRiH8tP2GZnQtyI t2d6aMxEUVlZQEJ8i0371kXoSzwNDmXfHRfNGgOnsnlvCd6tmxCx2B8Ke9mAhqSLTDl5/tZAyESOP D0mhdBlNLxbozCFwr1NmFRXWNRn720ux7LDJ9XxYiV6MKxcRk1IOcD9Uni/dTzVX5WfadIkQsYTNI ttU8wCTlfnCKLK9vr/xFkzydXQzvMIFT5V3uh3boo78U0tqK8LSEU2jARDlSz/nlrFH+8RP+dD7Vi +R8/3RiA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qtprh-00DQgw-EG; Fri, 20 Oct 2023 13:48:37 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 1AF32300392; Fri, 20 Oct 2023 15:48:37 +0200 (CEST) Date: Fri, 20 Oct 2023 15:48:36 +0200 From: Peter Zijlstra To: Frederic Weisbecker Cc: LKML , Boqun Feng , Joel Fernandes , Josh Triplett , Mathieu Desnoyers , Neeraj Upadhyay , "Paul E . McKenney" , Steven Rostedt , Uladzislau Rezki , rcu , Zqiang , Lai Jiangshan , "Liam R . Howlett" , Sebastian Siewior , Thomas Gleixner Subject: Re: [PATCH 4/4] Revert "kernel/sched: Modify initial boot task idle setup" Message-ID: <20231020134836.GE33965@noisy.programming.kicks-ass.net> References: <20231019233543.1243121-1-frederic@kernel.org> <20231019233543.1243121-5-frederic@kernel.org> <20231020082531.GS33217@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 20 Oct 2023 06:49:03 -0700 (PDT) On Fri, Oct 20, 2023 at 02:31:13PM +0200, Frederic Weisbecker wrote: > Yeah I can't say I really like the old coverage of PF_IDLE either. The new one > (after Liam's patch) is only halfway better defined though: it makes the boot > CPU's idle behave quite well: PF_IDLE is set on idle entry. And secondary > CPU's idle behave quite well also except when they go offline and then online > again. And then the secondary boot code becomes PF_IDLE. Bah offline, yeah, we should just not do that :-) > We probably need something like this: > > diff --git a/kernel/cpu.c b/kernel/cpu.c > index 3b9d5c7eb4a2..b24d7937b989 100644 > --- a/kernel/cpu.c > +++ b/kernel/cpu.c > @@ -1394,7 +1394,9 @@ void cpuhp_report_idle_dead(void) > { > struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state); > > + current->flags &= ~PF_IDLE; > BUG_ON(st->state != CPUHP_AP_OFFLINE); > + > rcutree_report_cpu_dead(); > st->state = CPUHP_AP_IDLE_DEAD; > /* > @@ -1642,6 +1644,8 @@ void cpuhp_online_idle(enum cpuhp_state state) > { > struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state); > > + current->flags |= PF_IDLE; > + > /* Happens for the boot cpu */ > if (state != CPUHP_AP_ONLINE_IDLE) > return; Yeah that works I suppose.