Re: [PATCH 1/7] work_on_cpu: helper for doing task on a CPU.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gautham R Shenoy
Date: Friday, October 24, 2008 - 6:41 am

On Fri, Oct 24, 2008 at 03:25:09PM +0200, Oleg Nesterov wrote:

No, we don't have that rule!

Because using Rusty's function with a seperate workqueue,
we queue the work item as follows:

	 get_online_cpus();
	 queue_work_on(cpu, &on_each_cpu_wq, &wfc.work);
	 flush_work(&wfc.work);
	 put_online_cpus();

The very fact that we've successfully queued the work-item means that
no cpu-hotplug operation can occur till our work item finishes
execution.

Hence the work can use get_online_cpus()!

Yes, we end up using additional resources in the form of another per-cpu
threads. But is that so much of an issue?


-- 
Thanks and Regards
gautham
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/7] work_on_cpu: helper for doing task on a CPU., Rusty Russell, (Wed Dec 31, 5:00 pm)
Re: [PATCH 2.6.19] mmc: Add support for SDHC cards, Pierre Ossman, (Mon Jan 1, 10:49 am)
Re: [PATCH 1/7] work_on_cpu: helper for doing task on a CPU., Gautham R Shenoy, (Thu Oct 23, 12:22 am)
Re: [PATCH 1/7] work_on_cpu: helper for doing task on a CPU., Gautham R Shenoy, (Thu Oct 23, 7:36 am)
do_boot_cpu can deadlock?, Oleg Nesterov, (Thu Oct 23, 10:02 am)
Re: do_boot_cpu can deadlock?, Gautham R Shenoy, (Thu Oct 23, 11:21 am)
Re: do_boot_cpu can deadlock?, Cyrill Gorcunov, (Thu Oct 23, 11:49 am)
Re: [PATCH 1/7] work_on_cpu: helper for doing task on a CPU., Gautham R Shenoy, (Fri Oct 24, 12:21 am)
Re: do_boot_cpu can deadlock?, Oleg Nesterov, (Fri Oct 24, 2:33 am)
Re: do_boot_cpu can deadlock?, Gautham R Shenoy, (Fri Oct 24, 2:53 am)
Re: do_boot_cpu can deadlock?, Oleg Nesterov, (Fri Oct 24, 3:51 am)
Re: [PATCH 1/7] work_on_cpu: helper for doing task on a CPU., Gautham R Shenoy, (Fri Oct 24, 4:40 am)
Re: [PATCH 1/7] work_on_cpu: helper for doing task on a CPU., Gautham R Shenoy, (Fri Oct 24, 6:41 am)