Messages in this thread | | | Date | Tue, 5 Aug 2008 21:57:06 +0200 | From | Pavel Machek <> | Subject | Re: + pm-introduce-new-interfaces-schedule_work_on-and-queue_work_on.patch added to -mm tree |
| |
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
| |