Messages in this thread | | | Date | Wed, 26 Sep 2012 11:12:30 -0700 | From | Tejun Heo <> | Subject | Re: [PATCH 02/12] workqueue: disallow set_cpus_allowed_ptr() from work item |
| |
On Thu, Sep 27, 2012 at 01:20:33AM +0800, Lai Jiangshan wrote: > workers depend on local-wake-up, if a work function change its CPU, it will > corrupt workqueue, disallow this behavior. > > When set_cpus_allowed_ptr() is called from workqueue.c in worker_thread(), > we clear the PF_WQ_WORKER before set_cpus_allowed_ptr() and set it back > after. (rescuer thread has no PF_WQ_WORKER, skip this behavior) > > It prevents other/future BUGs like https://bugzilla.kernel.org/show_bug.cgi?id=47301.
Hmmm... maybe. We better clear up PF_THREAD_BOUND semantics first tho.
I think the two possible choices are,
* Don't allow set_cpus_allowed_ptr() at all and make the caller responsible for turning it off if it explicitly wants to change cpus_allowed.
* Don't allow changing affinity from userland.
Peter, Thomas?
-- tejun
| |