Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1085992rdb; Fri, 20 Oct 2023 08:05:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwfBRUKmA0NIePnBgqmRc1ADr8fWS0goJ+Ah7L9g6UYAQknzunpKAJUFR4Sd/pKI5z/a7e X-Received: by 2002:a92:c244:0:b0:357:5276:ca77 with SMTP id k4-20020a92c244000000b003575276ca77mr2709181ilo.25.1697814332346; Fri, 20 Oct 2023 08:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697814332; cv=none; d=google.com; s=arc-20160816; b=SJqQuoBFAelIxHB6sMHAfarFhBc/f7G/uxgp+SnQfRNiwNE2oPagROuCUGpKCrDD81 ZIiJhc6gyKMNBXDUJMJjz6OsMrlgEk4E1ZCDtbnpGHdDSahBDBV7RgEhmuoi2mK5TCtX roRYnI8G9PotB1sC0J2LX0FGGjBSBnn+yaG1sSh238nv4B9btRBb9vQMJ6Fx/bo05vNd Xq/tw3/53qp8RS9WqFYhTVfrpsYszVAhSzUpN1t6BLPfE3kPgYJHX3YpnvwxFfkT3TNK 3LG54jVvrBNU5tU5bEKm9Fj39l18aoRkBZGt4V7yJijE/ZcxV+SsYmNsv5p+oHI3VEQm 4QnA== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=5MiVeITlOogS08Gp+gWn6Q1U7zGTSFuRkND6VHc/j+0=; fh=ZncMtJt5VeWNWMloX25fr2zgQ4RO4VKbj42neRRmL6I=; b=zaPW71eGzD1sScBCup42khOYc9d7M3OT504vQ/CbgpF/T+DltM6xJ35gohtQLXj2sG AmsiZk1T9Il4MggL/0DTK9yWgbAKbfgErsNxYKqcr2VjkCC5eWxWqvWPUyFHhARAU82Y wPlhEtSFhNz2Ol/JdcKCy05RlyOuUbO3zTHJXmR031mzKwSfQqq1y1rCoVhrvbkSJq69 v+LNoG19LbQc2cxhbqVweuWvQtUGLoQwgUv8f+2xLd3giZJ9vqlH0VYSNmOTD/nw9R6+ NeSNN1BTwCBdd2ADo1CkKP1JyqnpIeo7sXHSsiQqo9VqzTrIaVkGCBDcKai2PTzzIjAl eEgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UxRGt00V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id u185-20020a6385c2000000b005ad6babc019si1896288pgd.479.2023.10.20.08.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 08:05:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UxRGt00V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 28F94831440A; Fri, 20 Oct 2023 08:05:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377598AbjJTPFJ (ORCPT + 99 others); Fri, 20 Oct 2023 11:05:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377577AbjJTPFI (ORCPT ); Fri, 20 Oct 2023 11:05:08 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DCAAA3; Fri, 20 Oct 2023 08:05:07 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8341C433C8; Fri, 20 Oct 2023 15:05:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697814307; bh=clURIbd52HeyK7bdD03xC8cdh8ODd+8QDODz7a5HBio=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=UxRGt00VgsDzFi8PZH2yIs7xXNx62brRbiGWVS/Tz6mA2E8V8w8QHriOTpIYFoZhC EZC8eBJaeQFt4tckWmUU5Hq8EOEtzNLOz0lEKKNSz32eLng/mdUNQ1GSL3SPyJ+w9o AELOinTuPoalffgVUSxD+JQtzJsSYS7nivXgxpbkRmnTh6wqnTRj1c3Kr/DjYIiwPn mmxwyNVaCAG6tnZXORbElubGZC+O8f2x8w/SGYJ0ukBbotdiPlzAJ2fBHsLyeNuPEU A7x7BA1ZbCfTpHMtrh7gBO64vrzXpz2Cv5oBXlqH2m4tBKbhqqOAuMrSnnmTT9xaCu c69NQN2PoVUOQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 86DDACE059F; Fri, 20 Oct 2023 08:05:06 -0700 (PDT) Date: Fri, 20 Oct 2023 08:05:06 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Frederic Weisbecker , LKML , Boqun Feng , Joel Fernandes , Josh Triplett , Mathieu Desnoyers , Neeraj Upadhyay , 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: <6fdfe084-866a-4ab4-ac03-a8e0e5b5a35e@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20231019233543.1243121-1-frederic@kernel.org> <20231019233543.1243121-5-frederic@kernel.org> <20231020082531.GS33217@noisy.programming.kicks-ass.net> <20231020134836.GE33965@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231020134836.GE33965@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Fri, 20 Oct 2023 08:05:18 -0700 (PDT) On Fri, Oct 20, 2023 at 03:48:36PM +0200, Peter Zijlstra wrote: > 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. Booting up kernels being what it is, there might not be a completely pretty solution. Not that I would say "no" to such a solution should it appear, mind you! ;-) Thanx, Paul