Re: [PATCH] fix BUG using smp_processor_id() in touch_nmi_watchdogand touch_softlockup_watchdog

From: Yong Zhang
Date: Tue Aug 17 2010 - 05:37:41 EST


On Tue, Aug 17, 2010 at 5:24 PM, Sergey Senozhatsky
<sergey.senozhatsky@xxxxxxxxx> wrote:
> OK. Suppose (I don't know if it could) migration has happen
>
> acpi_os_stall
> Â Â Â Â__migration__
> Â Â Â Âtouch_nmi_watchdog
>
> How calling raw_smp_processor_id() (which is current_thread_info()->cpu)
> vs. preepmt_disable - smp_processor_id() will give us different CPUs?

I don't mean you will get different CPUS(sorry for my poor english).
I mean if the migration could happen, you want to touch_nmi_watchdog()
on CPU A(otherwise the watchdog will shout on us), but eventually we
touch_nmi_watchdog() on CPU B(because of migration),
and this is not what we want.

So preempt_disable() is redundant here.

>
>> So I prefer using __raw_get_cpu_var() as what we have been done before.
>>
>
> Hm...
>
> 26e09c6eee14f4827b55137ba0eedc4e77cd50ab

f69bcf60c3f17aa367e16eef7bc6ab001ea6d58a
2508ce1845a3b256798532b2c6b7997c2dc6533b

you can get the previous touch_*_watchdog there.

Thanks,
Yong
--
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/