From: Mark Lord <lkml@rtr.ca>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
"Brown, Len" <len.brown@intel.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
simon.derr@bull.net, Alexey Starikovskiy <astarikovskiy@suse.de>
Subject: Re: [patch 4/6] Fix SMP poweroff hangs
Date: Fri, 05 Oct 2007 09:40:23 -0400 [thread overview]
Message-ID: <47063EC7.4060105@rtr.ca> (raw)
In-Reply-To: <4702CCFB.1010000@pobox.com>
(reposting this.. somehow left LKML off the TO/CC list)
Mark Lord wrote:
> Eric W. Biederman wrote:
>> Mark Lord <lkml@rtr.ca> writes:
..
>> The code path on i386 should be:
>> machine_power_off
>> native_machine_power_off
>> machine_shutdown(); (which disables the other cpus)
>> smp_call_function
>> stop_this_cpu (on each cpu to be stopped.
>> pm_power_off(); (which turns off the power)
> ..
>> This does sound like a race of some sort.
>
> Mmm... thanks for the tour.
>
> The cpu hotplug code appears to take great precautions against internal races
> (dunno if it succeeds or not, though), but the correspond code in native_smp_send_stop()
> looks a bit iffy by comparison. I wonder if that's where it gets stuck?
>
> static void native_smp_send_stop(void)
> {
> /* Don't deadlock on the call lock in panic */
> int nolock = !spin_trylock(&call_lock);
> unsigned long flags;
>
> local_irq_save(flags);
> __smp_call_function(stop_this_cpu, NULL, 0, 0);
> if (!nolock)
> spin_unlock(&call_lock);
> disable_local_APIC();
> local_irq_restore(flags);
> }
>
> So basically, it tries to avoid races by grabbing the call_lock,
> but then ignores that lock and proceeds anyway. Recipe for a race?
Hmmmm.. and that code also fails to wait for the other CPU(s)
to actually halt (not sure how it could wait, but it doesn't even try),
so the other CPU(s) could easily still be active when we then stumble
into our ACPI call to turn the power off.
I suppose that might possibly hurt something.
Cheers
--
Mark Lord
Real-Time Remedies Inc.
mlord@pobox.com
next prev parent reply other threads:[~2007-10-05 13:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200710010820.l918KApW006834@imap1.linux-foundation.org>
[not found] ` <CFF307C98FEABE47A452B27C06B85BB603DA9AB8@hdsmsx411.amr.corp.intel.com>
[not found] ` <m1hclascwo.fsf@ebiederm.dsl.xmission.com>
[not found] ` <200710020048.38856.rjw@sisk.pl>
[not found] ` <m1myv2o13c.fsf@ebiederm.dsl.xmission.com>
[not found] ` <470198B1.2030003@rtr.ca>
[not found] ` <m1ve9pn8d1.fsf@ebiederm.dsl.xmission.com>
[not found] ` <470271EA.4040509@rtr.ca>
[not found] ` <m1ejgdif0f.fsf@ebiederm.dsl.xmission.com>
[not found] ` <4702C902.7000504@rtr.ca>
2007-10-05 13:39 ` [patch 4/6] Fix SMP poweroff hangs Mark Lord
[not found] ` <4702CCFB.1010000@pobox.com>
2007-10-05 13:40 ` Mark Lord [this message]
[not found] ` <47052292.3090400@rtr.ca>
[not found] ` <m1myuyv6qu.fsf@ebiederm.dsl.xmission.com>
2007-10-05 13:46 ` Mark Lord
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=47063EC7.4060105@rtr.ca \
--to=lkml@rtr.ca \
--cc=akpm@linux-foundation.org \
--cc=astarikovskiy@suse.de \
--cc=ebiederm@xmission.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=simon.derr@bull.net \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox