Re: [PATCH] x86: set percpu cpu0 lpj to default
From: Yinghai Lu
Date: Sat Jan 15 2011 - 21:32:39 EST
On Sat, Jan 15, 2011 at 5:09 AM, Tejun Heo <tj@xxxxxxxxxx> wrote:
> Hello,
>
> It doesn't seem like Christoph's recent patches had anything to do
> with it. The problem is the default loops_per_jiffy has initial value
> of 1 << 12 but the per cpu one used on x86 starts as zero triggering
> warning if delay is used before calibration.
>
> So, all that's necessary is just to initialize it with the same
> constant when defining the per cpu variable like the following. It
> probably would be better to define a named constant for it tho.
>
> Thanks.
>
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index 763df77..1898c70 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -131,7 +131,10 @@ DEFINE_PER_CPU(cpumask_var_t, cpu_core_map);
> EXPORT_PER_CPU_SYMBOL(cpu_core_map);
>
> /* Per CPU bogomips and other parameters */
> -DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);
> +DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info) =
> +{
> + .loops_per_jiffy = 1 << 12,
> +};
> EXPORT_PER_CPU_SYMBOL(cpu_info);
>
> atomic_t init_deasserted;
>
yes, it should work.
Thanks
Yinghai
--
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/