Messages in this thread | | | Date | Fri, 24 Oct 2008 16:23:59 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH 1/7] work_on_cpu: helper for doing task on a CPU. |
| |
On 10/24, Gautham R Shenoy wrote: > > On Fri, Oct 24, 2008 at 03:25:09PM +0200, Oleg Nesterov wrote: > > > > If we add another wq for work_on_cpu(), then we add another hard-to-maintain > > rule: get_online_cpus() must not be used by any work which can be queued > > on that wq. And, yet another per-cpu thread... > > 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.
Ah yes, thanks for correcting me.
> Yes, we end up using additional resources in the form of another per-cpu > threads. But is that so much of an issue?
Well, don't ask me... but the only reason why we need these threads is that we want to make work_on_cpu() useable from cpu-hotplug path, a bit strange ;)
Oleg.
| |