lkml.org 
[lkml]   [2008]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: cpusets and kthreads, inconsistent behaviour
On Tue, 10 Jun 2008, Max Krasnyansky wrote:

> Basically the issue is that current behaviour of the cpusets is inconsistent
> with regards to kthreads. Kthreads inherit cpuset from a parent properly but
> they simply ignore cpuset.cpus when their cpu affinity is set/updated.
> I think the behaviour must be consistent across the board. cpuset.cpus must
> apply to _all_ the tasks in the set, not just some of the tasks. If kthread
> must run on the cpus other than current_cpuset.cpus then it should detach from
> the cpuset.
>

I disagree that a cpuset's set of allowable cpus should apply to all tasks
attached to that cpuset. It's certainly beneficial to be able to further
constrict the set of allowed cpus for a task using sched_setaffinity().

It makes more sense to argue that for each task p, p->cpus_allowed is a
subset of task_cs(p)->cpus_allowed.

> To give you an example kthreads like scsi_eh, kswapd, kacpid, pdflush,
> kseriod, etc are all started with cpus_allows=ALL_CPUS even though they
> inherit a cpuset from kthreadd. Yes they can moved manually (with
> sched_setaffinity) but the behaviour is not consistent, and for no good
> reason. kthreads can be stopped/started at any time (module load for example)
> which means that the user will have to keep moving them.
>

This doesn't seem to be purely a kthread issue. Tasks can be moved to a
disjoint set of cpus by any caller to set_cpus_allowed_ptr() in the
kernel.

David


\
 
 \ /
  Last update: 2008-06-10 20:51    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site