Re: mmotm 2009-04-10-02-21 uploaded - forkbombed by work_for_cpu

From: Ali Gholami Rudi
Date: Wed Apr 15 2009 - 05:09:15 EST


Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> > [ Made it use smp_call_function_many() instead of looping over cpu's
> > with smp_call_function_single() - Linus ]
>
> <stares suspiciously at smp_call_function_many()>
>
> * smp_call_function_many(): Run a function on a set of other CPUs.
>
> "other". It refuses to call the function on *this* CPU. Tricky.
>
> Does this fix it up?
>
> --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c~a
> +++ a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
> @@ -204,7 +204,10 @@ static void drv_read(struct drv_cmd *cmd
>
> static void drv_write(struct drv_cmd *cmd)
> {
> - smp_call_function_many(cmd->mask, do_drv_write, cmd, 1);
> + unsigned cpu;
> +
> + for_each_cpu(cpu, cmd->mask)
> + smp_call_function_single(cpu, do_drv_write, cmd, 1);
> }
>
> static u32 get_cur_val(const struct cpumask *mask)
> _

Yes, it does fix it.

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