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

From: Sergey Senozhatsky
Date: Tue Aug 17 2010 - 04:40:14 EST


Hello,

On (08/17/10 11:16), Yong Zhang wrote:
> On Tue, Aug 17, 2010 at 10:59 AM, Frederic Weisbecker
> <fweisbec@xxxxxxxxx> wrote:
> > If preemption is disabled and you deal with the current cpu,
> > then please use __get_cpu_var, it makes the code more
> > readable:
> >
> >
> > void touch_softlockup_watchdog(void)
> > {
> >        preempt_disable();
> >        __(watchdog_touch_ts) = 0;
> >        preempt_enable();
> > }
>
> Why not use __raw_get_cpu_var() instead?
> You know adding preempt protection in touch_softlockup_watchdog()
> just suppress the warning. Am I missing something?
>

Sorry, my low level understanding of the __raw_get_cpu_var isn't very strong.
I assume it uses current_thread_info()->cpu in some cases (right?) or
percpu_from_op.


Should it be
acpi_os_stall
preepmt_disable
touch_nmi_watchdog
touch_softlockup_watchdog
preempt_enable

?

Sergey

Attachment: pgp00000.pgp
Description: PGP signature