Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5703757rwr; Tue, 9 May 2023 05:24:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4oXaZqqPr3TTGFhl2+LU5CeMpaA8pBEww9PonPY5WwyIL9ZcPdQB5qa/rcJ8VY4gxjBtdN X-Received: by 2002:a17:903:2281:b0:1a3:cd4c:8d08 with SMTP id b1-20020a170903228100b001a3cd4c8d08mr17193161plh.38.1683635052864; Tue, 09 May 2023 05:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683635052; cv=none; d=google.com; s=arc-20160816; b=dy1KwoU6p5Xi/N2FV5jYbCRlJ+kaiWb7FCOJCeyGrTDwNd+w2LEKkDF5R5yWQNcjMw DzAhxgwnY1KYL0eFAIDK/WXUfk5HX5dYOoHeDuPzT7joa4nqAC2SCiiXzYG0KncsDDNk ZEonsZuAHWNiIYzYNOMryI919I20EZhKL+as7PYu/WCp0jhNzR2nxGz4KspdVSrqH9ne QuHv9+RmuwteOJW4bRXdJztab4VnUv4WWjFY51IaZmw2yxIz1xp+kTQLPkYHT7GYRmfE xqdKZYZQxFpcb2gQqSmvewXvPx4OqHAjKhZ+WkZedBz1Nu4rrMnnzQUaA9YUAxh1qAg1 5hWA== 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=L8MCFM0FDR2P5xT6w7iIAowrB6rGKJkA6dzl9HivHWk=; b=CnAtaES7c6suYwzd5YOgLitlsO+ita39DRPAd7I8e2olGEoAdDRshcIBcQRb2XQl0G twdMeEMc+0aV2MhM/j3nvLLoJfDLmQz01ng8iTlzZxf50F2MH/41RZq0yid18zp2j2ym Lv1byiwk67KGPMFYyoHhsquI1RVEiKPQjhgouO9SWl0ZR+xG6nfWD9AWtT4NYDbzH6T2 hkohq6cCtp+JZHo2GjLDG5ap+RAvKtwZpJpKEC7Wwwd+brOfDCocPhHjOZ49Zsmmr/ev glD1Zx16wEDMkaqKbX1Dv7Qc/33eog8RUf6Z6mjcMYVFFL92igREIcEQn34mb/5IhihG UP9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WQKf9JTp; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 k6-20020a170902694600b001ab23cbe13bsi1351866plt.104.2023.05.09.05.23.59; Tue, 09 May 2023 05:24:12 -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=WQKf9JTp; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S235466AbjEIMHY (ORCPT + 99 others); Tue, 9 May 2023 08:07:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235359AbjEIMHX (ORCPT ); Tue, 9 May 2023 08:07:23 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48C5730D5; Tue, 9 May 2023 05:07:22 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683634040; 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=L8MCFM0FDR2P5xT6w7iIAowrB6rGKJkA6dzl9HivHWk=; b=WQKf9JTpFPSQGT0uFg5INijnVR8R5fqcikzHfuS5DVBLQGQ7GwJQT+EVszHAmjT/3/UBuz qVYnARbWYomJ6gliEb43t5la/h6VifzuO+zL/GRl0NjzHXmgK5N/FGwqL06FgLMkljqBFm XyfTJfmksGnqa6BjZhyerBbGE6iuFhkjn27fQrUXAQ1QApceQPW64uUNRla+fMpap+pUkk SWZ9l1mk0piAcuHN5EvFC700NqxfjfjIo2TZ35Uf44N6qz9M7DRMymepQA2ZWVsdTMQEJG ZopQRoGBKBzZCgD4GsYTMKx5vSxJBSs3/zJnl8HdNjGWI5X3/Fou00r0/4324g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683634040; 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=L8MCFM0FDR2P5xT6w7iIAowrB6rGKJkA6dzl9HivHWk=; b=HEbhRwUpE3y701WVF4If5EM5F8H8s6m0+F3iRYhv9+fKfUn3XmN66AS4uimVHFaZrmTvUY YoYD1EwiDwf+ofDQ== 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: <20230509100421.GU83892@hirez.programming.kicks-ass.net> References: <20230508181633.089804905@linutronix.de> <20230508185217.671595388@linutronix.de> <20230509100421.GU83892@hirez.programming.kicks-ass.net> Date: Tue, 09 May 2023 14:07:20 +0200 Message-ID: <87pm791zev.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:04, Peter Zijlstra wrote: > On Mon, May 08, 2023 at 09:43:39PM +0200, Thomas Gleixner wrote: >> + /* >> + * Sync point with wait_cpu_callin(). The AP doesn't wait here >> + * but just sets the bit to let the controlling CPU (BSP) know that >> + * it's got this far. >> + */ >> smp_callin(); >> >> - /* otherwise gcc will move up smp_processor_id before the cpu_init */ >> + /* Otherwise gcc will move up smp_processor_id() before cpu_init() */ >> barrier(); > > Not to the detriment of this patch, but this barrier() and it's comment > seem weird vs smp_callin(). That function ends with an atomic bitop (it > has to, at the very least it must not be weaker than store-release) but > also has an explicit wmb() to order setup vs CPU_STARTING. > > (arguably that should be a full fence *AND* get a comment) > > There is no way the smp_processor_id() referred to in this comment can > land before cpu_init() even without the barrier(). Right. Let me clean that up. Thanks, tglx