lkml.org 
[lkml]   [2008]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] sched: prevent bound kthreads from changing cpus_allowed
On 06/05, David Rientjes wrote:
>
> Kthreads that have called kthread_bind() are bound to specific cpus, so
> other tasks should not be able to change their cpus_allowed from under
> them. Otherwise, it is possible to move kthreads, such as the migration
> or software watchdog threads, so they are not allowed access to the cpu
> they work on.

Imho, this is very good change, but...

> @@ -180,6 +180,7 @@ void kthread_bind(struct task_struct *k, unsigned int cpu)
> set_task_cpu(k, cpu);
> k->cpus_allowed = cpumask_of_cpu(cpu);
> k->rt.nr_cpus_allowed = 1;
> + k->flags |= PF_THREAD_BOUND;

What if user-space moves this task right before "|= PF_THREAD_BOUND" ?

Oleg.



\
 
 \ /
  Last update: 2008-06-10 19:49    [W:0.075 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site