Messages in this thread | | | Date | Mon, 18 Mar 2013 10:41:40 +0100 | From | Ingo Molnar <> | Subject | Re: [PATCH REPOST v3.9-rc1] sched: replace PF_THREAD_BOUND with PF_NO_SETAFFINITY |
| |
* Tejun Heo <tj@kernel.org> wrote:
> PF_THREAD_BOUND was originally used to mark kernel threads which were > bound to a specific CPU using kthread_bind() and a task with the flag > set allows cpus_allowed modifications only to itself. Workqueue is > currently abusing it to prevent userland from meddling with > cpus_allowed of workqueue workers. > > What we need is a flag to prevent userland from messing with > cpus_allowed of certain kernel tasks. In kernel, anyone can > (incorrectly) squash the flag, and, for worker-type usages, > restricting cpus_allowed modification to the task itself doesn't > provide meaningful extra proection as other tasks can inject work > items to the task anyway. > > This patch replaces PF_THREAD_BOUND with PF_NO_SETAFFINITY. > sched_setaffinity() checks the flag and return -EINVAL if set. > set_cpus_allowed_ptr() is no longer affected by the flag. > > This will allow simplifying workqueue worker CPU affinity management.
Acked-by: Ingo Molnar <mingo@kernel.org>
I suspect you want to carry this in the workqueue tree, to enable those extra simplifications?
Thanks,
Ingo
| |