All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Zhang Rui <rui.zhang@intel.com>,
	Gautham R Shenoy <ego@in.ibm.com>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	harbour@sfinx.od.ua, rjw@sisk.pl
Subject: Re: + pm-introduce-new-interfaces-schedule_work_on-and-queue_work_on.patch added to -mm tree
Date: Tue, 5 Aug 2008 21:57:06 +0200	[thread overview]
Message-ID: <20080805195706.GD7939@elf.ucw.cz> (raw)
In-Reply-To: <20080725094246.GA110@tv-sign.ru>

Hi!

> > > This means that
> > >
> > >         pm-schedule-sysrq-poweroff-on-boot-cpu.patch
> > >
> > > is not 100% right. It is still possible to hang/deadlock if we race
> > > with cpu_down(first_cpu(cpu_online_map)).
> >
> > Yes, you're right.
> > But then should we fix disable_nonboot_cpus as well?
> >
> > int disable_nonboot_cpus(void)
> > {
> >         first_cpu = first_cpu(cpu_online_map);
> > 	...
> >
> >         for_each_online_cpu(cpu) {
> >                 if (cpu == first_cpu)
> >                         continue;
> >                 error = _cpu_down(cpu, 1);
> > 		...
> >         }
> > 	...
> > }
> 
> Note that disable_nonboot_cpus() does first_cpu = first_cpu() under
> cpu_maps_update_begin(), so we can't race with cpu-hotplug.
> 
> However, this afaics means that its name is wrong, and
> printk("Disabling non-boot CPUs ...\n") is not right too.
> What it does is disable_all_but_one_cpus().

I thought that first cpu is defined to be boot cpu?

> And, it is not clear why disable_nonboot_cpus() assumes that
> all but first_cpu(cpu_online_map) must have .hotpluggable == 1.

Where does it assume that?

It will fail if some CPUs can't be unplugged, and I'm afraid suspend
can't work in such case... 

> And, if one of the callers really need to preserve the boot CPU,
> I don't understand how it is guaranteed it must be first_cpu().

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2008-08-05 20:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-11 18:40 + pm-introduce-new-interfaces-schedule_work_on-and-queue_work_on.patch added to -mm tree akpm
2008-07-12 15:32 ` [PATCH] pm-introduce-new-interfaces-schedule_work_on-and-queue_work_on-cleanup Oleg Nesterov
2008-07-12 15:35   ` [PATCH] workqueues: queue_work() can use queue_work_on() Oleg Nesterov
2008-07-12 15:45   ` [PATCH] workqueues: schedule_on_each_cpu() can use schedule_work_on() Oleg Nesterov
2008-07-12 16:21 ` + pm-introduce-new-interfaces-schedule_work_on-and-queue_work_on.patch added to -mm tree Oleg Nesterov
2008-07-22 16:19   ` Gautham R Shenoy
2008-07-24 12:43     ` Oleg Nesterov
2008-07-25  1:17       ` Zhang Rui
2008-07-25  9:42         ` Oleg Nesterov
2008-08-05 19:57           ` Pavel Machek [this message]
2008-08-06 12:45             ` Oleg Nesterov

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=20080805195706.GD7939@elf.ucw.cz \
    --to=pavel@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=ego@in.ibm.com \
    --cc=harbour@sfinx.od.ua \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    --cc=rjw@sisk.pl \
    --cc=rui.zhang@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.