All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Liu, Chuansheng" <chuansheng.liu@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Yanmin Zhang <yanmin_zhang@linux.intel.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [PATCH] Fix the race between smp_call_function and CPU booting
Date: Mon, 12 Mar 2012 10:32:47 +0100	[thread overview]
Message-ID: <1331544767.18960.23.camel@twins> (raw)
In-Reply-To: <27240C0AC20F114CBF8149A2696CBE4A053BE8@SHSMSX101.ccr.corp.intel.com>

On Mon, 2012-03-12 at 09:27 +0000, Liu, Chuansheng wrote:
> From: liu chuansheng <chuansheng.liu@intel.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?

  reply	other threads:[~2012-03-12  9:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-12  9:27 [PATCH] Fix the race between smp_call_function and CPU booting Liu, Chuansheng
2012-03-12  9:32 ` Peter Zijlstra [this message]
2012-03-13  6:43   ` Liu, Chuansheng
2012-03-12  9:58 ` Peter Zijlstra
2012-03-13  6:46   ` Liu, Chuansheng
2012-03-13 15:57     ` Peter Zijlstra
2012-03-14  6:27       ` Liu, Chuansheng
2012-03-14  9:43         ` Peter Zijlstra
2012-03-15  0:11           ` Liu, Chuansheng
2012-03-15 10:46             ` Peter Zijlstra
2012-03-16  6:24               ` Liu, Chuansheng
2012-03-16  9:49                 ` Peter Zijlstra
2012-03-19  0:58                   ` Liu, Chuansheng
2012-03-19 10:03                     ` Peter Zijlstra
2012-03-20  0:22                       ` Liu, Chuansheng
2012-03-20 12:17                         ` Peter Zijlstra
2012-03-20 13:14                           ` Srivatsa S. Bhat
2012-03-20 13:41                             ` Peter Zijlstra
2012-03-20 15:02                               ` Srivatsa S. Bhat
2012-03-21  5:59                           ` Liu, Chuansheng
2012-03-21  9:12                             ` Peter Zijlstra
2012-03-21 12:25                             ` Peter Zijlstra
2012-03-22  0:59                               ` Liu, Chuansheng
2012-03-23 10:25                                 ` Peter Zijlstra
2012-03-23 11:32                                   ` Liu, Chuansheng
2012-03-23 12:02                                     ` Peter Zijlstra
2012-03-23 12:06                                       ` Liu, Chuansheng
2012-03-23 12:13                                         ` Peter Zijlstra
2012-03-23 12:21                                           ` Liu, Chuansheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1331544767.18960.23.camel@twins \
    --to=peterz@infradead.org \
    --cc=chuansheng.liu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=yanmin_zhang@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.