[patch 1/2] revert: x86: move prefill_possible_map calling early, fix - Kernel

This is a discussion on [patch 1/2] revert: x86: move prefill_possible_map calling early, fix - Kernel ; From: Chuck Ebbert revert: x86: move prefill_possible_map calling early, fix revert 4a7017370aa0a94a00ae5b5705e9169cdcae5fb8 This is the wrong fix: prefill_possible_map() needs to be available even when CONFIG_HOTPLUG_CPU is not set. A followon patch will do that. Signed-off-by: Chuck Ebbert --- --- b/include/asm-x86/smp.h ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: [patch 1/2] revert: x86: move prefill_possible_map calling early, fix

  1. [patch 1/2] revert: x86: move prefill_possible_map calling early, fix

    From: Chuck Ebbert

    revert: x86: move prefill_possible_map calling early, fix

    revert 4a7017370aa0a94a00ae5b5705e9169cdcae5fb8

    This is the wrong fix: prefill_possible_map() needs to be available
    even when CONFIG_HOTPLUG_CPU is not set. A followon patch will do that.

    Signed-off-by: Chuck Ebbert

    ---

    --- b/include/asm-x86/smp.h
    +++ a/include/asm-x86/smp.h
    @@ -116,6 +116,8 @@
    extern int __cpu_disable(void);
    extern void __cpu_die(unsigned int cpu);

    +extern void prefill_possible_map(void);
    +
    void smp_store_cpu_info(int id);
    #define cpu_physical_id(cpu) per_cpu(x86_cpu_to_apicid, cpu)

    @@ -124,15 +126,11 @@
    {
    return cpus_weight(cpu_callout_map);
    }
    -#endif /* CONFIG_SMP */
    -
    -#if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_CPU)
    -extern void prefill_possible_map(void);
    #else
    static inline void prefill_possible_map(void)
    {
    }
    +#endif /* CONFIG_SMP */
    -#endif

    extern unsigned disabled_cpus __cpuinitdata;

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. [patch 2/2] x86: move prefill_possible_map calling early, fix, V2

    From: Chuck Ebbert

    x86: move prefill_possible_map calling early, fix, V2

    fix:

    arch/x86/kernel/built-in.o: In function `setup_arch':
    : undefined reference to `prefill_possible_map'

    Fix this by making prefill_possible_map() available even when
    CONFIG_HOTPLUG_CPU is not set. The function is needed so that
    the number of possible CPUs can be determined.

    Tested on uniprocessor machine with CPU hotplug disabled.
    From boot log:
    Before: NR_CPUS: 512, nr_cpu_ids: 512, nr_node_ids 1
    After: NR_CPUS: 512, nr_cpu_ids: 1, nr_node_ids 1

    Signed-off-by: Chuck Ebbert

    ---

    Index: linux-2.6.26.noarch/arch/x86/kernel/smpboot.c
    ================================================== =================
    --- linux-2.6.26.noarch.orig/arch/x86/kernel/smpboot.c
    +++ linux-2.6.26.noarch/arch/x86/kernel/smpboot.c
    @@ -1254,39 +1254,8 @@ void __init native_smp_cpus_done(unsigne
    check_nmi_watchdog();
    }

    -#ifdef CONFIG_HOTPLUG_CPU
    -
    -static void remove_siblinginfo(int cpu)
    -{
    - int sibling;
    - struct cpuinfo_x86 *c = &cpu_data(cpu);
    -
    - for_each_cpu_mask_nr(sibling, per_cpu(cpu_core_map, cpu)) {
    - cpu_clear(cpu, per_cpu(cpu_core_map, sibling));
    - /*/
    - * last thread sibling in this cpu core going down
    - */
    - if (cpus_weight(per_cpu(cpu_sibling_map, cpu)) == 1)
    - cpu_data(sibling).booted_cores--;
    - }
    -
    - for_each_cpu_mask_nr(sibling, per_cpu(cpu_sibling_map, cpu))
    - cpu_clear(cpu, per_cpu(cpu_sibling_map, sibling));
    - cpus_clear(per_cpu(cpu_sibling_map, cpu));
    - cpus_clear(per_cpu(cpu_core_map, cpu));
    - c->phys_proc_id = 0;
    - c->cpu_core_id = 0;
    - cpu_clear(cpu, cpu_sibling_setup_map);
    -}
    -
    static int additional_cpus __initdata = -1;

    -static __init int setup_additional_cpus(char *s)
    -{
    - return s && get_option(&s, &additional_cpus) ? 0 : -EINVAL;
    -}
    -early_param("additional_cpus", setup_additional_cpus);
    -
    /*
    * cpu_possible_map should be static, it cannot change as cpu's
    * are onlined, or offlined. The reason is per-cpu data-structures
    @@ -1336,6 +1305,37 @@ __init void prefill_possible_map(void)
    nr_cpu_ids = possible;
    }

    +#ifdef CONFIG_HOTPLUG_CPU
    +
    +static void remove_siblinginfo(int cpu)
    +{
    + int sibling;
    + struct cpuinfo_x86 *c = &cpu_data(cpu);
    +
    + for_each_cpu_mask_nr(sibling, per_cpu(cpu_core_map, cpu)) {
    + cpu_clear(cpu, per_cpu(cpu_core_map, sibling));
    + /*/
    + * last thread sibling in this cpu core going down
    + */
    + if (cpus_weight(per_cpu(cpu_sibling_map, cpu)) == 1)
    + cpu_data(sibling).booted_cores--;
    + }
    +
    + for_each_cpu_mask_nr(sibling, per_cpu(cpu_sibling_map, cpu))
    + cpu_clear(cpu, per_cpu(cpu_sibling_map, sibling));
    + cpus_clear(per_cpu(cpu_sibling_map, cpu));
    + cpus_clear(per_cpu(cpu_core_map, cpu));
    + c->phys_proc_id = 0;
    + c->cpu_core_id = 0;
    + cpu_clear(cpu, cpu_sibling_setup_map);
    +}
    +
    +static __init int setup_additional_cpus(char *s)
    +{
    + return s && get_option(&s, &additional_cpus) ? 0 : -EINVAL;
    +}
    +early_param("additional_cpus", setup_additional_cpus);
    +
    static void __ref remove_cpu_from_maps(int cpu)
    {
    cpu_clear(cpu, cpu_online_map);
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. Re: [patch 2/2] x86: move prefill_possible_map calling early, fix, V2


    * Chuck Ebbert wrote:

    > From: Chuck Ebbert
    >
    > x86: move prefill_possible_map calling early, fix, V2
    >
    > fix:
    >
    > arch/x86/kernel/built-in.o: In function `setup_arch':
    > : undefined reference to `prefill_possible_map'
    >
    > Fix this by making prefill_possible_map() available even when
    > CONFIG_HOTPLUG_CPU is not set. The function is needed so that
    > the number of possible CPUs can be determined.
    >
    > Tested on uniprocessor machine with CPU hotplug disabled.
    > From boot log:
    > Before: NR_CPUS: 512, nr_cpu_ids: 512, nr_node_ids 1
    > After: NR_CPUS: 512, nr_cpu_ids: 1, nr_node_ids 1


    applied to tip/x86/core, thanks Chuck! Made it a single delta patch, to
    ease backporting.

    Ingo
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread