Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2394219rwr; Sat, 6 May 2023 10:01:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5XmmL43fSF0O9IO9lD1ihh5fQQL3Z2XlyXBKDsBdseQyLuhkZK7PNynp5f0D0uDz++td4G X-Received: by 2002:a05:6a00:c8a:b0:643:a50d:d805 with SMTP id a10-20020a056a000c8a00b00643a50dd805mr7245355pfv.16.1683392514702; Sat, 06 May 2023 10:01:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683392514; cv=none; d=google.com; s=arc-20160816; b=rRWgZ9bO5t+fd94HVVtVmrKzcgjc2utmoFnRXE4ngQ0/GDvK/g2lviNZGShC+yzcPT mzTV8tjx30xRixHxGISpIRlSx+us2V9mm3+GoFLBlRX8Cr5v/FIokDYX55bBV/qGoVXv Yb9nGgwAemT+uEJF6O+LsO28d2qlBm1nScH/7W93cVMy8K/pCaFa4I07lyf/VbblMyvw PWvC1YbqjDdAxrF8lVhTnMLBSrpleFj12icd1Wybq1+4pOc3jQ2uOUg4774+JK7isLlD cyh7xXR8yDkOLnmNDkxht0XfED231I40rMViPrwF8BKLbf9SJZJPuWr8GpMQ74sngSSM txXg== 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=NXHfBgcGHt/ZfPwa+T595dnepfFJKJnpLjR3JhBl6Q0=; b=mrEXH8ISTW0iktWhS4KHXTKJY5VZKJvv99rn8g16IUirmoNvF/XeE6q4Pj1xSlOSVe RtUsSxuiC2UGLM6cqnHH5NRgRJFQJz4Eq3E5ZuOxXVhkTjSHjVRZsqiLQoKyzKVVWmoj Z3mlTWiiSbIis1ua+tBOkjXMCDH7VX2vkuSbDhtWLjCW3IPxbaMTP9eTtwLSzq1hQCwJ u48HPao0lpaOArIKPmwRqiRSGIX9y9/LS0+lhcsHyCYYoJhWJqhdAhov5n6bHpK7t3Zb PDYOVzrpgMgG/6wbFuQ6uGlS6sRiLkWT6VzJLsE9vvf25A2ITsd10ZspNMo+4tksOuF2 cGFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=1czMZh1c; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=qtQ0xS4F; 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 p19-20020a637f53000000b0052c63ee5905si4418944pgn.614.2023.05.06.10.01.40; Sat, 06 May 2023 10:01:54 -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=1czMZh1c; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=qtQ0xS4F; 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 S229694AbjEFQWo (ORCPT + 99 others); Sat, 6 May 2023 12:22:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjEFQWm (ORCPT ); Sat, 6 May 2023 12:22:42 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D00F4680; Sat, 6 May 2023 09:22:41 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683390158; 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=NXHfBgcGHt/ZfPwa+T595dnepfFJKJnpLjR3JhBl6Q0=; b=1czMZh1cRjeqiQ2TZA6GbMVHHXEF93eQIVvQioB8FE/pRwMNCJ9iNbT002o3Vf8Q1PmjjT pMzD7AC5NROe0zWPr/xkstx8tP21FQigIYhXnCedHf48++FNK52empvCyZE4IMSf7ryah7 wwDm68n14K3LZeFvyQ99Fwubq6JJjmTxOyIllycil0ZJfXjm8tULzw2/ivE/eeRZ3vZ2Ce eFzoWJEYtyiUQ3YTBmQpXzsA8QFgMuJS8CeTY8f2OfEh+NvACDq69zDAubztHsM41nl1p1 k+Q1vY7kiaQqTaWRFrb4KJC+127qTmzlxib6lozIfkeM3gQq7L3F5SIRCIw/xg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683390158; 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=NXHfBgcGHt/ZfPwa+T595dnepfFJKJnpLjR3JhBl6Q0=; b=qtQ0xS4FhuHdv2/qWAJNtp26GqvWQxksH6Mo/Q1MgLXE9WE0n6Pih7C913p3eWGR7QXk2c rCYD41DUjLVIXsBw== To: "Michael Kelley (LINUX)" , LKML Cc: "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 Subject: RE: [patch V2 38/38] x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it In-Reply-To: References: <20230504185733.126511787@linutronix.de> <20230504185938.393373946@linutronix.de> Date: Sat, 06 May 2023 18:22:37 +0200 Message-ID: <87sfc92zw2.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 Sat, May 06 2023 at 00:53, Michael Kelley wrote: > From: Thomas Gleixner Sent: Thursday, May 4, 2023 12:03 PM > [snip] > >> @@ -934,10 +961,10 @@ static void announce_cpu(int cpu, int ap >> if (!node_width) >> node_width = num_digits(num_possible_nodes()) + 1; /* + '#' */ >> >> - if (cpu == 1) >> - printk(KERN_INFO "x86: Booting SMP configuration:\n"); >> - >> if (system_state < SYSTEM_RUNNING) { >> + if (num_online_cpus() == 1) > > Unfortunately, this new check doesn't work. Here's the output I get: > > [ 0.721384] smp: Bringing up secondary CPUs ... > [ 0.725359] smpboot: x86: Booting SMP configuration: > [ 0.729249] .... node #0, CPUs: #2 > [ 0.729654] smpboot: x86: Booting SMP configuration: > [ 0.737247] #4 > > Evidently num_online_cpus() isn't updated until after all the primary > siblings get started. Duh. Where is that brown paperbag? > When booting with cpuhp.parallel=0, the output is good. Exactly that was on the command line when I quickly booted that change :( The below should fix it for real. Thanks, tglx --- --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -951,9 +951,9 @@ static int wakeup_secondary_cpu_via_init /* reduce the number of lines printed when booting a large cpu count system */ static void announce_cpu(int cpu, int apicid) { + static int width, node_width, first = 1; static int current_node = NUMA_NO_NODE; int node = early_cpu_to_node(cpu); - static int width, node_width; if (!width) width = num_digits(num_possible_cpus()) + 1; /* + '#' sign */ @@ -962,7 +962,7 @@ static void announce_cpu(int cpu, int ap node_width = num_digits(num_possible_nodes()) + 1; /* + '#' */ if (system_state < SYSTEM_RUNNING) { - if (num_online_cpus() == 1) + if (first) pr_info("x86: Booting SMP configuration:\n"); if (node != current_node) { @@ -975,11 +975,11 @@ static void announce_cpu(int cpu, int ap } /* Add padding for the BSP */ - if (num_online_cpus() == 1) + if (first) pr_cont("%*s", width + 1, " "); + first = 0; pr_cont("%*s#%d", width - num_digits(cpu), " ", cpu); - } else pr_info("Booting Node %d Processor %d APIC 0x%x\n", node, cpu, apicid);