online, possible and disabled cpus

Craig Jackson cjackson at ebscohost.com
Mon Oct 22 13:25:50 EDT 2012


> -----Original Message-----
> From: kernelnewbies-bounces at kernelnewbies.org [mailto:kernelnewbies-
> bounces at kernelnewbies.org] On Behalf Of Robert P. J. Day
> Sent: Monday, October 22, 2012 12:47 PM
> To: Kernel Newbies
> Subject: online, possible and disabled cpus
> 
> 
>   at this point, i'm trying to rationalize why i'm seeing this in the
> output of dmesg:
> 
> [    0.000000] smpboot: Allowing 16 CPUs, 8 hotplug CPUs
> 
> on my quad-core asus laptop, as in -- where is that "16" coming from?
> if i list /proc/cpuinfo, i see 8 processors, so i'm just trying to
> understand what "16" represents, so let's read backwards.
> 
>   first, that line above seems to be printed from
> arch/x86/kernel/smpboot.c:
> 
>         pr_info("Allowing %d CPUs, %d hotplug CPUs\n",
>                 possible, max_t(int, possible - num_processors, 0));
> 
> so, *apparently*, by that time, the boot process has established that
> there are 16 "possible" processors, but only 8 actual ones.  but who
> decided there were 16 "possible" processors?
> 
>   just above that in the same file, we have:
> 
>         if (setup_possible_cpus == -1) {
>                 possible = num_processors;
>   #ifdef CONFIG_HOTPLUG_CPU
>                 if (setup_max_cpus)
>                         possible += disabled_cpus;
>   #else
>                 if (possible > i)
>                         possible = i;
>   #endif
>         } else
>                 possible = setup_possible_cpus;
> 
>         total_cpus = max_t(int, possible, num_processors +
> disabled_cpus);
> 
>   whoa, so it appears that we get "possible" cpus from adding the
> number of *actual* cpus to the number of "disabled" cpus.  but what is
> a "disabled" cpu, and who decides how many there are?
> 
>   last thing i notice is this earlier in my dmesg output:
> 
> [    0.000000] ACPI: PM-Timer IO Port: 0x408
> [    0.000000] ACPI: Local APIC address 0xfee00000
> [    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x04] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x06] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x05] lapic_id[0x01] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x06] lapic_id[0x03] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x07] lapic_id[0x05] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x08] lapic_id[0x07] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x09] lapic_id[0x08] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0a] lapic_id[0x09] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0b] lapic_id[0x0a] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0c] lapic_id[0x0b] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0d] lapic_id[0x0c] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0e] lapic_id[0x0d] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0f] lapic_id[0x0e] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x10] lapic_id[0x0f] disabled)
> 
> which certainly seems to be related to all of this -- 8 enabled and 8
> disabled.  so i'm going to keep following this back, unless someone
> wants to break it to me what is going on.
> 

You'll have to investigate those disabled CPUs, but I'm guessing that
the presence
or absence of hyperthreading may have something to do with it.

Craig Jackson



More information about the Kernelnewbies mailing list