Re: [PATCH 3/6] INIT: Limit the number of per cpu calibration bootup messages

H. Peter Anvin
2009-11-16T21:50:21Z

On 11/16/2009 01:45 PM, Mike Travis wrote:
>
>
> Ingo Molnar wrote:
>> * Mike Travis <travis@sgi.com> wrote:
>>
>>> --- linux.orig/init/calibrate.c
>>> +++ linux/init/calibrate.c
>>> @@ -123,23 +123,26 @@
>>> {
>>> unsigned long ticks, loopbit;
>>> int lps_precision = LPS_PREC;
>>> + bool boot_cpu = (smp_processor_id() == 0);
>>
>> this code is shared by other architectures too - are you sure
>> smp_processor_id()==0 is a proper 'I am the boot CPU' assumption
>> everywhere?
>>
>> Ingo
>
> This was where having the boot_cpu_id would have been handy.
>
> I could add something like:
>
> --- linux.orig/init/main.c
> +++ linux/init/main.c
> @@ -539,13 +539,15 @@
> * Activate the first processor.
> */
>
> +int boot_cpu_id __read_mostly;
^^^^^^^^^^^^^^^
> +
> static void __init boot_cpu_init(void)
> {
> - int cpu = smp_processor_id();
> + int boot_cpu_id = smp_processor_id();
^^^^^^^^^^^^^^^
> /* Mark the boot cpu "present", "online" etc for SMP and UP case */

Doesn't really work, does it?

I also still think that wrapping it in an inline would be good.

-hpa