Re: [RFC] cpuset update_cgroup_cpus_allowed

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Paul Jackson <pj@...>
Cc: Paul Menage <menage@...>, <nickpiggin@...>, <a.p.zijlstra@...>, <balbir@...>, <linux-kernel@...>, <clg@...>, <ebiederm@...>, <containers@...>, <serue@...>, <svaidy@...>, Andrew Morton <akpm@...>, <xemul@...>
Date: Monday, October 15, 2007 - 2:49 pm

On Mon, 15 Oct 2007, Paul Jackson wrote:


By making this cpus_equal() and not cpus_intersects(), you're trying to 
make sure that t->cpus_allowed is always equal to *cpus for each task in 
the iterator.


Yet by not doing any locking here to prevent a cpu from being 
hot-unplugged, you can race and allow the hot-unplug event to happen 
before calling set_cpus_allowed().  That makes this entire function a 
no-op with set_cpus_allowed() returning -EINVAL for every call, which 
isn't caught, and no error is reported to userspace.

Now all the tasks in the cpuset have an inconsistent state with respect to 
their p->cpuset->cpus_allowed, because that was already updated in 
update_cpumask().  When userspace checks that value via the 'cpus' file, 
this is the value returned which is actually not true at all for any of 
the tasks in 'tasks'.

		David
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] cpuset update_cgroup_cpus_allowed, Paul Jackson, (Mon Oct 15, 3:11 am)
Re: [RFC] cpuset update_cgroup_cpus_allowed, Paul Menage, (Mon Oct 15, 5:24 pm)
Re: [RFC] cpuset update_cgroup_cpus_allowed, Paul Jackson, (Mon Oct 15, 8:16 pm)
Re: [RFC] cpuset update_cgroup_cpus_allowed, Paul Menage, (Mon Oct 15, 8:20 pm)
Re: [RFC] cpuset update_cgroup_cpus_allowed, Paul Jackson, (Mon Oct 15, 10:34 pm)
Re: [RFC] cpuset update_cgroup_cpus_allowed, Paul Menage, (Tue Oct 16, 6:07 am)
Re: [RFC] cpuset update_cgroup_cpus_allowed, Paul Menage, (Tue Oct 16, 1:12 am)
Re: [RFC] cpuset update_cgroup_cpus_allowed, Paul Jackson, (Tue Oct 16, 1:20 am)
Re: [RFC] cpuset update_cgroup_cpus_allowed, David Rientjes, (Mon Oct 15, 2:49 pm)
Re: [RFC] cpuset update_cgroup_cpus_allowed, Paul Jackson, (Tue Oct 16, 2:07 am)
Re: [RFC] cpuset update_cgroup_cpus_allowed, David Rientjes, (Tue Oct 16, 2:21 am)
Re: [RFC] cpuset update_cgroup_cpus_allowed, Paul Jackson, (Tue Oct 16, 5:16 am)
Re: [RFC] cpuset update_cgroup_cpus_allowed, David Rientjes, (Tue Oct 16, 2:27 pm)
Re: [RFC] cpuset update_cgroup_cpus_allowed, Paul Jackson, (Tue Oct 16, 7:14 pm)
Re: [RFC] cpuset update_cgroup_cpus_allowed, Paul Jackson, (Mon Oct 15, 10:32 pm)