<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/cpuset.c, branch v2.6.27.26</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/cpuset.c?h=v2.6.27.26</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/cpuset.c?h=v2.6.27.26'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2008-12-05T18:55:10Z</updated>
<entry>
<title>cpuset: fix regression when failed to generate sched domains</title>
<updated>2008-12-05T18:55:10Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2008-11-18T06:02:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a677fac636cbd9fdd1520e16514dee91f59f80be'/>
<id>urn:sha1:a677fac636cbd9fdd1520e16514dee91f59f80be</id>
<content type='text'>
commit 700018e0a77b4113172257fcdaa1c58e27a5074f upstream.

Impact: properly rebuild sched-domains on kmalloc() failure

When cpuset failed to generate sched domains due to kmalloc()
failure, the scheduler should fallback to the single partition
'fallback_doms' and rebuild sched domains, but now it only
destroys but not rebuilds sched domains.

The regression was introduced by:

| commit dfb512ec4834116124da61d6c1ee10fd0aa32bd6
| Author: Max Krasnyansky &lt;maxk@qualcomm.com&gt;
| Date:   Fri Aug 29 13:11:41 2008 -0700
|
|    sched: arch_reinit_sched_domains() must destroy domains to force rebuild

After the above commit, partition_sched_domains(0, NULL, NULL) will
only destroy sched domains and partition_sched_domains(1, NULL, NULL)
will create the default sched domain.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Max Krasnyansky &lt;maxk@qualcomm.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>cpuset: avoid changing cpuset's cpus when -errno returned</title>
<updated>2008-09-13T21:41:50Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2008-09-13T09:33:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4e74339af6a59c061cf02f1ac497766bca1de19a'/>
<id>urn:sha1:4e74339af6a59c061cf02f1ac497766bca1de19a</id>
<content type='text'>
After the patch:

commit 0b2f630a28d53b5a2082a5275bc3334b10373508
Author: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Date:   Fri Jul 25 01:47:21 2008 -0700

    cpusets: restructure the function update_cpumask() and update_nodemask()

It might happen that 'echo 0 &gt; /cpuset/sub/cpus' returned failure but 'cpus'
has been changed, because cpus was changed before calling heap_init() which
may return -ENOMEM.

This patch restores the orginal behavior.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Paul Menage &lt;menage@google.com&gt;
Cc: Paul Jackson &lt;pj@sgi.com&gt;
Cc: Miao Xie &lt;miaox@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>sched, cpuset: rework sched domains and CPU hotplug handling (v4)</title>
<updated>2008-08-14T09:23:51Z</updated>
<author>
<name>Max Krasnyansky</name>
<email>maxk@qualcomm.com</email>
</author>
<published>2008-08-11T21:33:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cf417141cbb3a4ceb5cca15b2c1f099bd0a6603c'/>
<id>urn:sha1:cf417141cbb3a4ceb5cca15b2c1f099bd0a6603c</id>
<content type='text'>
This is an updated version of my previous cpuset patch on top of
the latest mainline git.
The patch fixes CPU hotplug handling issues in the current cpusets code.
Namely circular locking in rebuild_sched_domains() and unsafe access to
the cpu_online_map in the cpuset cpu hotplug handler.

This version includes changes suggested by Paul Jackson (naming, comments,
style, etc). I also got rid of the separate workqueue thread because it is
now safe to call get_online_cpus() from workqueue callbacks.

Here are some more details:

rebuild_sched_domains() is the only way to rebuild sched domains
correctly based on the current cpuset settings. What this means
is that we need to be able to call it from different contexts,
like cpu hotplug for example.
Also latest scheduler code in -tip now calls rebuild_sched_domains()
directly from functions like arch_reinit_sched_domains().

In order to support that properly we need to rework cpuset locking
rules to avoid circular dependencies, which is what this patch does.
New lock nesting rules are explained in the comments.
We can now safely call rebuild_sched_domains() from virtually any
context. The only requirement is that it needs to be called under
get_online_cpus(). This allows cpu hotplug handlers and the scheduler
to call rebuild_sched_domains() directly.
The rest of the cpuset code now offloads sched domains rebuilds to
a workqueue (async_rebuild_sched_domains()).

This version of the patch addresses comments from the previous review.
I fixed all miss-formated comments and trailing spaces.

I also factored out the code that builds domain masks and split up CPU and
memory hotplug handling. This was needed to simplify locking, to avoid unsafe
access to the cpu_online_map from mem hotplug handler, and in general to make
things cleaner.

The patch passes moderate testing (building kernel with -j 16, creating &amp;
removing domains and bringing cpus off/online at the same time) on the
quad-core2 based machine.

It passes lockdep checks, even with preemptable RCU enabled.
This time I also tested in with suspend/resume path and everything is working
as expected.

Signed-off-by: Max Krasnyansky &lt;maxk@qualcomm.com&gt;
Acked-by: Paul Jackson &lt;pj@sgi.com&gt;
Cc: menage@google.com
Cc: a.p.zijlstra@chello.nl
Cc: vegard.nossum@gmail.com
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>cpuset: clean up cpuset hierarchy traversal code</title>
<updated>2008-07-30T16:41:44Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2008-07-30T05:33:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=aeed682421a5ebfbf46940e30c3d1caf3bc64304'/>
<id>urn:sha1:aeed682421a5ebfbf46940e30c3d1caf3bc64304</id>
<content type='text'>
Use cpuset.stack_list rather than kfifo, so we avoid memory allocation
for kfifo.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Cc: Paul Menage &lt;menage@google.com&gt;
Cc: Cedric Le Goater &lt;clg@fr.ibm.com&gt;
Cc: Balbir Singh &lt;balbir@in.ibm.com&gt;
Cc: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: 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: fix wrong calculation of relax domain level</title>
<updated>2008-07-30T16:41:44Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2008-07-30T05:33:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=93a6557558a13f9ff35213efeca483f353c39dd3'/>
<id>urn:sha1:93a6557558a13f9ff35213efeca483f353c39dd3</id>
<content type='text'>
When multiple cpusets are overlapping in their 'cpus' and hence they
form a single sched domain, the largest sched_relax_domain_level among
those should be used. But when top_cpuset's sched_load_balance is
set, its sched_relax_domain_level is used regardless other sub-cpusets'.

This patch fixes it by walking the cpuset hierarchy to find the largest
sched_relax_domain_level.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Paul Menage &lt;menage@google.com&gt;
Cc: Cedric Le Goater &lt;clg@fr.ibm.com&gt;
Cc: Balbir Singh &lt;balbir@in.ibm.com&gt;
Cc: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Reviewed-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: speed up sched domain partition</title>
<updated>2008-07-30T16:41:44Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2008-07-30T05:33:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f5393693e96393131a4a2e2743f883986d508503'/>
<id>urn:sha1:f5393693e96393131a4a2e2743f883986d508503</id>
<content type='text'>
All child cpusets contain a subset of the parent's cpus, so we can skip
them when partitioning sched domains. This decreases 'csa' greately for
cpusets with multi-level hierarchy.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Paul Menage &lt;menage@google.com&gt;
Cc: Cedric Le Goater &lt;clg@fr.ibm.com&gt;
Cc: Balbir Singh &lt;balbir@in.ibm.com&gt;
Cc: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Reviewed-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: a bit cleanup for scan_for_empty_cpusets()</title>
<updated>2008-07-30T16:41:44Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2008-07-30T05:33:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8d1e6266f512b3a94ef6d33528ff385f1aea0392'/>
<id>urn:sha1:8d1e6266f512b3a94ef6d33528ff385f1aea0392</id>
<content type='text'>
clean up hierarchy traversal code

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Paul Menage &lt;menage@google.com&gt;
Cc: Cedric Le Goater &lt;clg@fr.ibm.com&gt;
Cc: Balbir Singh &lt;balbir@in.ibm.com&gt;
Cc: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Paul Jackson &lt;pj@sgi.com&gt;
Cc: Cliff Wickman &lt;cpw@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: two minor code-cleanups</title>
<updated>2008-07-25T17:53:38Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2008-07-25T08:47:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=da5ef6bb96158b0fc0d808704237a453af449124'/>
<id>urn:sha1:da5ef6bb96158b0fc0d808704237a453af449124</id>
<content type='text'>
In cpuset_update_task_memory_state() local variable struct task_struct
*tsk = current;

And local variable tsk is used 14 times and statement task_cs(tsk) is used
twice in this function.  So using task_cs(tsk) instead of task_cs(current)
is better for readability.

And "(struct cgroup_scanner *)&amp;scan" is not good for readability also.
(and "container_of" is used in cpuset_do_move_task(), not
"(cpuset_hotplug_scanner *)scan")

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Acked-by: Paul Menage &lt;menage@google.com&gt;
Cc: 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: code-cleanup for started_after</title>
<updated>2008-07-25T17:53:38Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2008-07-25T08:47:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=02412483777651a26b19a75e49c2a451a174ca9c'/>
<id>urn:sha1:02412483777651a26b19a75e49c2a451a174ca9c</id>
<content type='text'>
cgroup(cgroup_scan_tasks) will initialize heap-&gt;gt for us.  This patch
removes started_after() and its helper-function.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Acked-by: Paul Menage &lt;menage@google.com&gt;
Cc: 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: don't pass empty cpumasks to partition_sched_domains()</title>
<updated>2008-07-25T17:53:38Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2008-07-25T08:47:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=489a5393a20dcbf91104052120eb2eff8791b61b'/>
<id>urn:sha1:489a5393a20dcbf91104052120eb2eff8791b61b</id>
<content type='text'>
I create lots of empty cpusets(empty cpumasks) and turn off the
"sched_load_balance" in top cpuset.

I found that all these empty cpumasks are passed to
partition_sched_domains() in rebuild_sched_domains(), it's very
time-consuming for partition_sched_domains() and it's not need.

It also reduce memory consumed and some works in rebuild_sched_domains()
too.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Acked-by: Paul Menage &lt;menage@google.com&gt;
Cc: 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>
</feed>
