<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/cpuset.c, branch v2.6.26</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.26</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.26'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2008-07-13T09:37:02Z</updated>
<entry>
<title>cpusets, hotplug, scheduler: fix scheduler domain breakage</title>
<updated>2008-07-13T09:37:02Z</updated>
<author>
<name>Dmitry Adamushko</name>
<email>dmitry.adamushko@gmail.com</email>
</author>
<published>2008-07-13T00:10:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3e84050c81ffb4961ef43d20e1fb1d7607167d83'/>
<id>urn:sha1:3e84050c81ffb4961ef43d20e1fb1d7607167d83</id>
<content type='text'>
Commit f18f982ab ("sched: CPU hotplug events must not destroy scheduler
domains created by the cpusets") introduced a hotplug-related problem as
described below:

Upon CPU_DOWN_PREPARE,

  update_sched_domains() -&gt; detach_destroy_domains(&amp;cpu_online_map)

does the following:

/*
 * Force a reinitialization of the sched domains hierarchy. The domains
 * and groups cannot be updated in place without racing with the balancing
 * code, so we temporarily attach all running cpus to the NULL domain
 * which will prevent rebalancing while the sched domains are recalculated.
 */

The sched-domains should be rebuilt when a CPU_DOWN ops. has been
completed, effectively either upon CPU_DEAD{_FROZEN} (upon success) or
CPU_DOWN_FAILED{_FROZEN} (upon failure -- restore the things to their
initial state). That's what update_sched_domains() also does but only
for !CPUSETS case.

With f18f982ab, sched-domains' reinitialization is delegated to
CPUSETS code:

cpuset_handle_cpuhp() -&gt; common_cpu_mem_hotplug_unplug() -&gt;
rebuild_sched_domains()

Being called for CPU_UP_PREPARE and if its callback is called after
update_sched_domains()), it just negates all the work done by
update_sched_domains() -- i.e. a soon-to-be-offline cpu is included in
the sched-domains and that makes it visible for the load-balancer
while the CPU_DOWN ops. is in progress.

__migrate_live_tasks() moves the tasks off a 'dead' cpu (it's already
"offline" when this function is called).

try_to_wake_up() is called for one of these tasks from another CPU -&gt;
the load-balancer (wake_idle()) picks up a "dead" CPU and places the
task on it. Then e.g. BUG_ON(rq-&gt;nr_running) detects this a bit later
-&gt; oops.

Signed-off-by: Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;
Tested-by: Vegard Nossum &lt;vegard.nossum@gmail.com&gt;
Cc: Paul Menage &lt;menage@google.com&gt;
Cc: Max Krasnyansky &lt;maxk@qualcomm.com&gt;
Cc: Paul Jackson &lt;pj@sgi.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: miaox@cn.fujitsu.com
Cc: rostedt@goodmis.org
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2008-06-20T19:37:13Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2008-06-20T19:37:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1f1e2ce8a55bac60ff165d353c6b882e750c9092'/>
<id>urn:sha1:1f1e2ce8a55bac60ff165d353c6b882e750c9092</id>
<content type='text'>
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  softlockup: fix NMI hangs due to lock race - 2.6.26-rc regression
  rcupreempt: remove export of rcu_batches_completed_bh
  cpuset: limit the input of cpuset.sched_relax_domain_level
</content>
</entry>
<entry>
<title>cpuset: limit the input of cpuset.sched_relax_domain_level</title>
<updated>2008-06-19T07:45:36Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2008-05-13T02:27:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=30e0e178193d4221abc9926b07a4c7661c7cc4a9'/>
<id>urn:sha1:30e0e178193d4221abc9926b07a4c7661c7cc4a9</id>
<content type='text'>
We allow the inputs to be [-1 ... SD_LV_MAX), and return -EINVAL
for inputs outside this range.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Paul Menage &lt;menage@google.com&gt;
Acked-by: Paul Jackson &lt;pj@sgi.com&gt;
Acked-by: Hidetoshi Seto &lt;seto.hidetoshi@jp.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>sched: CPU hotplug events must not destroy scheduler domains created by the cpusets</title>
<updated>2008-06-19T07:14:51Z</updated>
<author>
<name>Max Krasnyansky</name>
<email>maxk@qualcomm.com</email>
</author>
<published>2008-05-29T18:17:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f18f982abf183e91f435990d337164c7a43d1e6d'/>
<id>urn:sha1:f18f982abf183e91f435990d337164c7a43d1e6d</id>
<content type='text'>
First issue is not related to the cpusets. We're simply leaking doms_cur.
It's allocated in arch_init_sched_domains() which is called for every
hotplug event. So we just keep reallocation doms_cur without freeing it.
I introduced free_sched_domains() function that cleans things up.

Second issue is that sched domains created by the cpusets are
completely destroyed by the CPU hotplug events. For all CPU hotplug
events scheduler attaches all CPUs to the NULL domain and then puts
them all into the single domain thereby destroying domains created
by the cpusets (partition_sched_domains).
The solution is simple, when cpusets are enabled scheduler should not
create default domain and instead let cpusets do that. Which is
exactly what the patch does.

Signed-off-by: Max Krasnyansky &lt;maxk@qualcomm.com&gt;
Cc: pj@sgi.com
Cc: menage@google.com
Cc: rostedt@goodmis.org
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>cpusets: fix bug when adding nonexistent cpu or mem</title>
<updated>2008-06-06T18:29:11Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2008-06-06T05:46:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=37340746a66e5e7feed5945f28cb75d90a8fd9f6'/>
<id>urn:sha1:37340746a66e5e7feed5945f28cb75d90a8fd9f6</id>
<content type='text'>
Adding a nonexistent cpu to a cpuset will be omitted quietly.  It should
return -EINVAL.

Example: (real_nr_cpus &lt;= 4 &lt; NR_CPUS or cpu#4 was just offline)

# cat cpus
0-1
# /bin/echo 4 &gt; cpus
# /bin/echo $?
0
# cat cpus

#

The same occurs when add a nonexistent mem.
This patch will fix this bug.
And when *buf == "", the check is unneeded.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Acked-by: Paul Jackson &lt;pj@sgi.com&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Fix cpuset sched_relax_domain_level control file</title>
<updated>2008-05-08T17:46:56Z</updated>
<author>
<name>Paul Menage</name>
<email>menage@google.com</email>
</author>
<published>2008-05-07T03:42:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5be7a4792a31df6f2cd44bfba8da467ea20a0642'/>
<id>urn:sha1:5be7a4792a31df6f2cd44bfba8da467ea20a0642</id>
<content type='text'>
Due to a merge conflict, the sched_relax_domain_level control file was marked
as being handled by cpuset_read/write_u64, but the code to handle it was
actually in cpuset_common_file_read/write.

Since the value being written/read is in fact a signed integer, it should be
treated as such; this patch adds cpuset_read/write_s64 functions, and uses
them to handle the sched_relax_domain_level file.

With this patch, the sched_relax_domain_level can be read and written, and the
correct contents seen/updated.

Signed-off-by: Paul Menage &lt;menage@google.com&gt;
Cc: Hidetoshi Seto &lt;seto.hidetoshi@jp.fujitsu.com&gt;
Cc: Paul Jackson &lt;pj@sgi.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Reviewed-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Cpuset hardwall flag: add a mem_hardwall flag to cpusets</title>
<updated>2008-04-29T15:06:11Z</updated>
<author>
<name>Paul Menage</name>
<email>menage@google.com</email>
</author>
<published>2008-04-29T08:00:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=786083667e0ced85ce17c4c0b6c57a9f47c5b9f2'/>
<id>urn:sha1:786083667e0ced85ce17c4c0b6c57a9f47c5b9f2</id>
<content type='text'>
This flag provides the hardwalling properties of mem_exclusive, without
enforcing the exclusivity.  Either mem_hardwall or mem_exclusive is sufficient
to prevent GFP_KERNEL allocations from passing outside the cpuset's assigned
nodes.

Signed-off-by: Paul Menage &lt;menage@google.com&gt;
Acked-by: Paul Jackson &lt;pj@sgi.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Cpuset hardwall flag: switch cpusets to use the bulk cgroup_add_files() API</title>
<updated>2008-04-29T15:06:11Z</updated>
<author>
<name>Paul Menage</name>
<email>menage@google.com</email>
</author>
<published>2008-04-29T08:00:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=addf2c739d9015d3e9c0500b58a3af051cd58ea7'/>
<id>urn:sha1:addf2c739d9015d3e9c0500b58a3af051cd58ea7</id>
<content type='text'>
Currently the cpusets mem_exclusive flag is overloaded to mean both
"no-overlapping" and "no GFP_KERNEL allocations outside this cpuset".

These patches add a new mem_hardwall flag with just the allocation restriction
part of the mem_exclusive semantics, without breaking backwards-compatibility
for those who continue to use just mem_exclusive.  Additionally, the cgroup
control file registration for cpusets is cleaned up to reduce boilerplate.

This patch:

This change tidies up the cpusets control file definitions, and reduces the
amount of boilerplate required to add/change control files in the future.

Signed-off-by: Paul Menage &lt;menage@google.com&gt;
Reviewed-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Paul Jackson &lt;pj@sgi.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>kernel/cpuset.c: make 3 functions static</title>
<updated>2008-04-29T15:06:11Z</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@kernel.org</email>
</author>
<published>2008-04-29T08:00:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9e0c914cabc6d75d2eafdff00671a2ad683a5e3c'/>
<id>urn:sha1:9e0c914cabc6d75d2eafdff00671a2ad683a5e3c</id>
<content type='text'>
Make the following needlessly global functions static:

- cpuset_test_cpumask()
- cpuset_change_cpumask()
- cpuset_do_move_task()

Signed-off-by: Adrian Bunk &lt;bunk@kernel.org&gt;
Acked-by: Paul Jackson &lt;pj@sgi.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>CGroup API files: update cpusets to use cgroup structured file API</title>
<updated>2008-04-29T15:06:08Z</updated>
<author>
<name>Paul Menage</name>
<email>menage@google.com</email>
</author>
<published>2008-04-29T08:00:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=700fe1ab99240c1a9c4d155e2a0612a1b044bb69'/>
<id>urn:sha1:700fe1ab99240c1a9c4d155e2a0612a1b044bb69</id>
<content type='text'>
Many of the cpusets control files are simple integer values, which don't
require the overhead of memory allocations for reads and writes.

Move the handlers for these control files into cpuset_read_u64() and
cpuset_write_u64().

[akpm@linux-foundation.org: ad dmissing `break']
Signed-off-by: Paul Menage &lt;menage@google.com&gt;
Cc: "Li Zefan" &lt;lizf@cn.fujitsu.com&gt;
Cc: Balbir Singh &lt;balbir@in.ibm.com&gt;
Cc: Paul Jackson &lt;pj@sgi.com&gt;
Cc: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Cc: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: "YAMAMOTO Takashi" &lt;yamamoto@valinux.co.jp&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
