[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [patch V2 38/38] x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it
- To: Thomas Gleixner <tglx@xxxxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>
- From: "Michael Kelley (LINUX)" <mikelley@xxxxxxxxxxxxx>
- Date: Sun, 7 May 2023 04:14:08 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tY+33LB3hpYbL+5KySOOuT2kgudd0q8zip8Km+tZUW0=; b=HsbO2Hg/BfAWKLCq3ms5vQtUdu90499l2F02MZEUB2OOug5qU0GDLmIQb+gHCs24WETGvcw4dFl/4BwHgAxR8t7A4CJEsMdRS3oZcT7gTfalYWwDqxiAzyovFVtQx6wbD/u0g75bd8VChDffhWJxFUpHPTDx3yu3eE6f8XwFiltVl5XGstJzF/yUDvHypLduT+Qf35KyWlYvaPZX54HE8IDLV4YbcbN/saO2tpYyz/n02dOjZGmsLAdF9vR5bvuTvw4oec7Hx/x8evkEXqTCbAM6xIVPTjIeJxaDVQ77RQHBbBdua1PnzS7DBoMs4MZihDW6u8JmnKNX/sZQ9nHI2g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HgnllY60NA2knDjebBuJ09rGPOHOpdonOv0P9PLzY+zYpEo8LTZPIsd74baBbQ//vFyOx+4wg8Hd4CyAqZ3+7cF/wcrwNLGvwZKjrfDZPy65spPoVKmW7VteNgJbfTJ/vOzXKBXL6K3PUI436ByiAk2MRm0kUwbROWZzaPrFMyFOlWTDDofeMTZUvhQ/hboktMfj2ZQCgZ7b8xIs85o7PX1RyZrWBWjuOkNBfzQ7eG+SvjEzN75K7LITuK5JYLsF0dOA4Hae44bbsImNmx8r3WdWiJwVdlXysFY67vIIXlFFLrmxqkeBb6hBrwBmAckexrqbe/qsJMM6tk9WRqVuRw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com;
- Cc: "x86@xxxxxxxxxx" <x86@xxxxxxxxxx>, David Woodhouse <dwmw2@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Brian Gerst <brgerst@xxxxxxxxx>, Arjan van de Veen <arjan@xxxxxxxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Paul McKenney <paulmck@xxxxxxxxxx>, Tom Lendacky <thomas.lendacky@xxxxxxx>, Sean Christopherson <seanjc@xxxxxxxxxx>, Oleksandr Natalenko <oleksandr@xxxxxxxxxxxxxx>, Paul Menzel <pmenzel@xxxxxxxxxxxxx>, "Guilherme G. Piccoli" <gpiccoli@xxxxxxxxxx>, Piotr Gorski <lucjan.lucjanov@xxxxxxxxx>, Usama Arif <usama.arif@xxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Will Deacon <will@xxxxxxxxxx>, Guo Ren <guoren@xxxxxxxxxx>, "linux-csky@xxxxxxxxxxxxxxx" <linux-csky@xxxxxxxxxxxxxxx>, Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>, "linux-mips@xxxxxxxxxxxxxxx" <linux-mips@xxxxxxxxxxxxxxx>, "James E.J. Bottomley" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, Helge Deller <deller@xxxxxx>, "linux-parisc@xxxxxxxxxxxxxxx" <linux-parisc@xxxxxxxxxxxxxxx>, Paul Walmsley <paul.walmsley@xxxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, "linux-riscv@xxxxxxxxxxxxxxxxxxx" <linux-riscv@xxxxxxxxxxxxxxxxxxx>, Mark Rutland <Mark.Rutland@xxxxxxx>, Sabin Rapan <sabrapan@xxxxxxxxxx>
- Delivery-date: Sun, 07 May 2023 04:14:39 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=56484d60-8d00-4ff5-b5f8-f0c240f99b2d;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-05-07T04:09:18Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
- Thread-index: AQHZfrsPO9aHmT4GeE2OzCti+2hGJa9MacrggAEGsICAAMVzgA==
- Thread-topic: [patch V2 38/38] x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it
From: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Sent: Saturday, May 6, 2023 9:23 AM
>
> On Sat, May 06 2023 at 00:53, Michael Kelley wrote:
> > From: Thomas Gleixner <tglx@xxxxxxxxxxxxx> 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);
This works. dmesg output is clean for these guest VM combinations
on Hyper-V that I tested:
* Normal VM: 16 vCPUs in 1 NUMA node and 32 vCPUs in 2 NUMA nodes
* Same configs for a SEV-SNP Confidential VM with paravisor
Tested with and without cpuhp.parallel=0
For the entire series:
Tested-by: Michael Kelley <mikelley@xxxxxxxxxxxxx>
|