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]
Message-ID: <27240C0AC20F114CBF8149A2696CBE4A054D6A@SHSMSX101.ccr.corp.intel.com>
Date:	Tue, 13 Mar 2012 06:43:42 +0000
From:	"Liu, Chuansheng" <chuansheng.liu@...el.com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Yanmin Zhang <yanmin_zhang@...ux.intel.com>,
	"tglx@...utronix.de" <tglx@...utronix.de>
Subject: RE: [PATCH] Fix the race between smp_call_function and CPU booting



> -----Original Message-----
> From: Peter Zijlstra [mailto:peterz@...radead.org]
> Sent: Monday, March 12, 2012 5:33 PM
> To: Liu, Chuansheng
> Cc: linux-kernel@...r.kernel.org; Yanmin Zhang; tglx@...utronix.de
> Subject: Re: [PATCH] Fix the race between smp_call_function and CPU booting
> 
> On Mon, 2012-03-12 at 09:27 +0000, Liu, Chuansheng wrote:
> > From: liu chuansheng <chuansheng.liu@...el.com>
> > Subject: [PATCH] Fix the race between smp_call_function and CPU
> > booting
> >
> > When system is waking up from suspend state, sometimes the
> > smp_call_function is called which will cause deadlock specially on the
> > platform which just has two CPUs.
> >
> > CPU0:                                           CPU1:
> > pm_suspend -->
> > suspend_devices_and_enter -->
> > enable_nonboot_cpus -->
> > _cpu_up -->
> > __cpu_up -->
> > native_cpu_up
> >                                                 start_secondary
> >                                                         -- set
> cpu online
> >                                                         --
> waiting for the active state new thread call:
> > smp_call_function -->
> > smp_call_function_many -->
> > smp_call_function_single -->
> >    -- csd_lock
> >    -- generic_exec_single -->
> >    -- arch_send_call_function_single_ipi
> >    -- csd_lock_wait
> >
> > At this time, both CPUs are blocked. Normally the CPU0 will set the
> > CPU1 with active state after finished the _cpu_up calling, but CPU1
> > can not handle the IPI due to the corresponding irq is still disabled,
> > which will be enabled after waiting for the active state.
> >
> > The solution is just to send smp call to active cpus instead of online
> > cpus.
> 
> Wouldn't http://lkml.org/lkml/2011/12/15/255 also solve that?
Yes, the patch in http://lkml.org/lkml/2011/12/15/255 also solve it. But it moved the action of setting active state into the start_secondary thru cpu_notifier starting,
If so, more simpler solution is calling set_cpu_active directly in function start_secondary, do not need register cpu_online/cpu_starting cpu_notifier in function migration_init at all.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ