lkml.org 
[lkml]   [2013]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2013-03-18 12:01    [W:0.074 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site