Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5703578rwr; Tue, 9 May 2023 05:24:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ74n4wyZDgW9K1Ud74feXd2yYt4DDiJ15DGf+RAOuPDlLHKrP82vXACdDUBS8BpA/DqjXU+ X-Received: by 2002:a17:90a:70c2:b0:246:5fbb:43bf with SMTP id a2-20020a17090a70c200b002465fbb43bfmr14136513pjm.4.1683635044015; Tue, 09 May 2023 05:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683635043; cv=none; d=google.com; s=arc-20160816; b=ezm2trqaFKwPi0Fjny5hD9ko1kULcPqN4XgddwkUfR71fFXHFZcXgIpyRdAOxlhDxB GLH6mk8wzIZDAtgmi3A4i32xbk+6NCByCsFkmo2PfiSsd72NEfJetZEi5Fi4LCGDd1eQ yyhiVZbsLgTOfqNRAoWMdEQjkH48U52V35tdyWva1Fm5MVJhIL/UohnCK2o3fGztPV9B jw+e/Dh82jPxylJGwBau3Nf9O2WBetlbk2/G+n6Z0NX4aibWUAvc9cVIaeEE9ZIWd6lS abjxv4rf3yLbvfONYAz3Uwn0RzJisFOQ+gZu6ZoLccSbsuByOzhNoqkflkEeHFK05irm LhGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=JzzIG9diO0rBmRqXNA2vITQ7laniNDqcQjUI61xR0zc=; b=nYvnJONwpvQT4anQ+m09tQSnvwwgrNBpagMSOBzeiwx3veKJus/tSSgQDszTsZZo/R zGy9BDQc+6Z+yKJeG68w4qVButS79dUlXdoYOrd6GKQ87ylbDdbggyDpIOjpSy/eHdmG Nb4U0IU7gS04fCNjbFz/YAmsZoZEZP+z/U5RWdcHYfMDM8Jof6T2Ln1KTNUi/KJefOVo A+nbai+GXx7wZnad5KPDOK7KgCwriL/yAw42FIJEZcJPL1SeqEQ+V2PhkqeqJjc3y3M9 expFTBLuoWKDgvATJ60rHkLwSL1ZAUV4TwGt9sVMy8eM/ESgJu626F02/hL6nsjFs0qF N7UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=yGBgjZXX; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=fUDzvynz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k71-20020a636f4a000000b0051b7b83d6b1si1370712pgc.241.2023.05.09.05.23.31; Tue, 09 May 2023 05:24:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=yGBgjZXX; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=fUDzvynz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235533AbjEIMJ1 (ORCPT + 99 others); Tue, 9 May 2023 08:09:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235531AbjEIMJZ (ORCPT ); Tue, 9 May 2023 08:09:25 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1C402698; Tue, 9 May 2023 05:09:24 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683634163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JzzIG9diO0rBmRqXNA2vITQ7laniNDqcQjUI61xR0zc=; b=yGBgjZXX7JUQf9ai2BxNAcE40QqlbbCZvKDivZ8fc+Ky9mAI/0ueQdDzNtDVuilsrvxJJO lJ5mhaodIDGsYlQ0IXQvZ9tZytQody5uNCpERHh6I46d500WQf2vjLSAaSUonj1VM7S27k ijKtUP6m6oR8ZuUZRNmjosyunXeQRrX26+o4C4sXaWq1kq0u9zQ+mYZBmKYBPh+6Nuyz6J ha7BRefsXdcuOh0ABNgFpkVgNGLsV2g+kzTN5Fz65Tux9qtwNHNwfsc6BXGq7Rw/qb5o8h P5C95248r6aRH+rMJbxtb6dCXh+b7CBcpY6Wfvf0ny/k2Ev6eJ3Z3YSX7s1qRw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683634163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JzzIG9diO0rBmRqXNA2vITQ7laniNDqcQjUI61xR0zc=; b=fUDzvynzHE21pHjVwgqzy6eWSyFgbVajRkQas+BUCgv8eUYACTe86SoKSEy94dBf+BbPut fM8AU/kPvb2mGGDg== To: Peter Zijlstra Cc: LKML , x86@kernel.org, David Woodhouse , Andrew Cooper , Brian Gerst , Arjan van de Veen , Paolo Bonzini , Paul McKenney , Tom Lendacky , Sean Christopherson , Oleksandr Natalenko , Paul Menzel , "Guilherme G. Piccoli" , Piotr Gorski , Usama Arif , Juergen Gross , Boris Ostrovsky , xen-devel@lists.xenproject.org, Russell King , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Guo Ren , linux-csky@vger.kernel.org, Thomas Bogendoerfer , linux-mips@vger.kernel.org, "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, Mark Rutland , Sabin Rapan , "Michael Kelley (LINUX)" , David Woodhouse Subject: Re: [patch v3 08/36] x86/smpboot: Split up native_cpu_up() into separate phases and document them In-Reply-To: <20230509103146.GW83892@hirez.programming.kicks-ass.net> References: <20230508181633.089804905@linutronix.de> <20230508185217.671595388@linutronix.de> <20230509103146.GW83892@hirez.programming.kicks-ass.net> Date: Tue, 09 May 2023 14:09:23 +0200 Message-ID: <87jzxh1zbg.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain 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_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Tue, May 09 2023 at 12:31, Peter Zijlstra wrote: > On Mon, May 08, 2023 at 09:43:39PM +0200, Thomas Gleixner wrote: >> + /* >> + * Wait for the AP to mark itself online, so the core caller >> + * can drop sparse_irq_lock. >> + */ >> + while (!cpu_online(cpu)) >> + schedule(); >> +} > > These schedule() loops make me itch... this is basically Ye Olde yield() > loop with all it's known 'benefits'. > > Now, I don't think it's horribly broken, we're explicitly waiting on > another CPU and can't have priority inversions, but yuck! > > It could all be somewhat cleaned up with wait_var_event{_timeout}() and > wake_up_var(), but I'm really not sure that's worth it. But at least it > requires a comment to justify. All of them are gone with the later patches and the control CPU will just go straight to wait for the completion in the core code.