lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 17 Aug 2010 12:24:07 +0300
From:	Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To:	Yong Zhang <yong.zhang0@...il.com>
Cc:	Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Don Zickus <dzickus@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fix BUG using smp_processor_id() in touch_nmi_watchdog
 and touch_softlockup_watchdog

On (08/17/10 17:05), Yong Zhang wrote:
> >> 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.
> 
> The difference is __raw_get_cpu_var() is using raw_smp_processor_id().
> 
> >
> >
> > Should it be
> > acpi_os_stall
> >        preepmt_disable
> >        touch_nmi_watchdog
> >                touch_softlockup_watchdog
> >        preempt_enable
> 
> Actually I don't think this is helpful for the whole function. Because
> if acpi_os_stall()
> migrate(I don't know if it could) to another CPU just before
> preepmt_disable(), we'll
> be on the wrong way. Adding preempt protection is just smoothing the warning.
>

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?
 
> So I prefer using __raw_get_cpu_var() as what we have been done before.
> 

Hm...

26e09c6eee14f4827b55137ba0eedc4e77cd50ab

 static void __touch_watchdog(void)
 {
-       int this_cpu = raw_smp_processor_id();
+       int this_cpu = smp_processor_id();


	Sergey

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ