• Andi Kleen's avatar
    [PATCH] x86_64: New heuristics to find out hotpluggable CPUs. · 420f8f68
    Andi Kleen authored
    With a NR_CPUS==128 kernel with CPU hotplug enabled we would waste 4MB
    on per CPU data of all possible CPUs.  The reason was that HOTPLUG
    always set up possible map to NR_CPUS cpus and then we need to allocate
    that much (each per CPU data is roughly ~32k now)
    
    The underlying problem is that ACPI didn't tell us how many hotplug CPUs
    the platform supports.  So the old code just assumed all, which would
    lead to this memory wastage.
    
    This implements some new heuristics:
    
     - If the BIOS specified disabled CPUs in the ACPI/mptables assume they
       can be enabled later (this is bending the ACPI specification a bit,
       but seems like a obvious extension)
     - The user can overwrite it with a new additionals_cpus=NUM option
     - Otherwise use half of the available CPUs or 2, whatever is more.
    
    Cc: ashok.raj@intel.com
    Cc: len.brown@intel.com
    Signed-off-by: default avatarAndi Kleen <ak@suse.de>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    420f8f68
smp.h 3.09 KB