lkml.org 
[lkml]   [2007]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH x86 for review II] [24/39] i386: use smp_call_function_single()
    Date

    From: Alexey Dobriyan <adobriyan@openvz.org>
    It will execure cpuid only on the cpu we need.

    Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org>
    Signed-off-by: Andi Kleen <ak@suse.de>

    ---

    arch/i386/kernel/cpuid.c | 7 ++-----
    1 file changed, 2 insertions(+), 5 deletions(-)

    Index: linux/arch/i386/kernel/cpuid.c
    ===================================================================
    --- linux.orig/arch/i386/kernel/cpuid.c
    +++ linux/arch/i386/kernel/cpuid.c
    @@ -48,7 +48,6 @@ static struct class *cpuid_class;
    #ifdef CONFIG_SMP

    struct cpuid_command {
    - int cpu;
    u32 reg;
    u32 *data;
    };
    @@ -57,8 +56,7 @@ static void cpuid_smp_cpuid(void *cmd_bl
    {
    struct cpuid_command *cmd = (struct cpuid_command *)cmd_block;

    - if (cmd->cpu == smp_processor_id())
    - cpuid(cmd->reg, &cmd->data[0], &cmd->data[1], &cmd->data[2],
    + cpuid(cmd->reg, &cmd->data[0], &cmd->data[1], &cmd->data[2],
    &cmd->data[3]);
    }

    @@ -70,11 +68,10 @@ static inline void do_cpuid(int cpu, u32
    if (cpu == smp_processor_id()) {
    cpuid(reg, &data[0], &data[1], &data[2], &data[3]);
    } else {
    - cmd.cpu = cpu;
    cmd.reg = reg;
    cmd.data = data;

    - smp_call_function(cpuid_smp_cpuid, &cmd, 1, 1);
    + smp_call_function_single(cpu, cpuid_smp_cpuid, &cmd, 1, 1);
    }
    preempt_enable();
    }
    -
    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/
    \
     
     \ /
      Last update: 2007-02-12 08:49    [W:0.023 / U:32.132 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site