<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/sched.c, branch mybooklive</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/sched.c?h=mybooklive</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/sched.c?h=mybooklive'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2010-04-01T22:58:19Z</updated>
<entry>
<title>sched: Fix SCHED_MC regression caused by change in sched cpu_power</title>
<updated>2010-04-01T22:58:19Z</updated>
<author>
<name>Suresh Siddha</name>
<email>suresh.b.siddha@intel.com</email>
</author>
<published>2010-03-11T08:45:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8cefe8b8849627e6e90337107f58e2b1972e7906'/>
<id>urn:sha1:8cefe8b8849627e6e90337107f58e2b1972e7906</id>
<content type='text'>
commit dd5feea14a7de4edbd9f36db1a2db785de91b88d upstream

On platforms like dual socket quad-core platform, the scheduler load
balancer is not detecting the load imbalances in certain scenarios. This
is leading to scenarios like where one socket is completely busy (with
all the 4 cores running with 4 tasks) and leaving another socket
completely idle. This causes performance issues as those 4 tasks share
the memory controller, last-level cache bandwidth etc. Also we won't be
taking advantage of turbo-mode as much as we would like, etc.

Some of the comparisons in the scheduler load balancing code are
comparing the "weighted cpu load that is scaled wrt sched_group's
cpu_power" with the "weighted average load per task that is not scaled
wrt sched_group's cpu_power". While this has probably been broken for a
longer time (for multi socket numa nodes etc), the problem got aggrevated
via this recent change:

|
|  commit f93e65c186ab3c05ce2068733ca10e34fd00125e
|  Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
|  Date:   Tue Sep 1 10:34:32 2009 +0200
|
|  sched: Restore __cpu_power to a straight sum of power
|

Also with this change, the sched group cpu power alone no longer reflects
the group capacity that is needed to implement MC, MT performance
(default) and power-savings (user-selectable) policies.

We need to use the computed group capacity (sgs.group_capacity, that is
computed using the SD_PREFER_SIBLING logic in update_sd_lb_stats()) to
find out if the group with the max load is above its capacity and how
much load to move etc.

Reported-by: Ma Ling &lt;ling.ma@intel.com&gt;
Initial-Analysis-by: Zhang, Yanmin &lt;yanmin_zhang@linux.intel.com&gt;
Signed-off-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
[ -v2: build fix ]
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;1266970432.11588.22.camel@sbs-t61.sc.intel.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;

</content>
</entry>
<entry>
<title>sched: Don't use possibly stale sched_class</title>
<updated>2010-03-15T15:50:17Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2010-02-17T08:05:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=04833a6a2dd0f236d1f5c17075a34df9df74351c'/>
<id>urn:sha1:04833a6a2dd0f236d1f5c17075a34df9df74351c</id>
<content type='text'>
commit 83ab0aa0d5623d823444db82c3b3c34d7ec364ae upstream.

setscheduler() saves task-&gt;sched_class outside of the rq-&gt;lock held
region for a check after the setscheduler changes have become
effective. That might result in checking a stale value.

rtmutex_setprio() has the same problem, though it is protected by
p-&gt;pi_lock against setscheduler(), but for correctness sake (and to
avoid bad examples) it needs to be fixed as well.

Retrieve task-&gt;sched_class inside of the rq-&gt;lock held region.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sched: Fix SMT scheduler regression in find_busiest_queue()</title>
<updated>2010-03-15T15:50:17Z</updated>
<author>
<name>Suresh Siddha</name>
<email>suresh.b.siddha@intel.com</email>
</author>
<published>2010-02-13T01:14:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=76d071362505e9ea55210b4b5cb7a6824c4c0b22'/>
<id>urn:sha1:76d071362505e9ea55210b4b5cb7a6824c4c0b22</id>
<content type='text'>
commit 9000f05c6d1607f79c0deacf42b09693be673f4c upstream.

Fix a SMT scheduler performance regression that is leading to a scenario
where SMT threads in one core are completely idle while both the SMT threads
in another core (on the same socket) are busy.

This is caused by this commit (with the problematic code highlighted)

   commit bdb94aa5dbd8b55e75f5a50b61312fe589e2c2d1
   Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
   Date:   Tue Sep 1 10:34:38 2009 +0200

   sched: Try to deal with low capacity

   @@ -4203,15 +4223,18 @@ find_busiest_queue()
   ...
	for_each_cpu(i, sched_group_cpus(group)) {
   +	unsigned long power = power_of(i);

   ...

   -	wl = weighted_cpuload(i);
   +	wl = weighted_cpuload(i) * SCHED_LOAD_SCALE;
   +	wl /= power;

   -	if (rq-&gt;nr_running == 1 &amp;&amp; wl &gt; imbalance)
   +	if (capacity &amp;&amp; rq-&gt;nr_running == 1 &amp;&amp; wl &gt; imbalance)
		continue;

On a SMT system, power of the HT logical cpu will be 589 and
the scheduler load imbalance (for scenarios like the one mentioned above)
can be approximately 1024 (SCHED_LOAD_SCALE). The above change of scaling
the weighted load with the power will result in "wl &gt; imbalance" and
ultimately resulting in find_busiest_queue() return NULL, causing
load_balance() to think that the load is well balanced. But infact
one of the tasks can be moved to the idle core for optimal performance.

We don't need to use the weighted load (wl) scaled by the cpu power to
compare with  imabalance. In that condition, we already know there is only a
single task "rq-&gt;nr_running == 1" and the comparison between imbalance,
wl is to make sure that we select the correct priority thread which matches
imbalance. So we really need to compare the imabalnce with the original
weighted load of the cpu and not the scaled load.

But in other conditions where we want the most hammered(busiest) cpu, we can
use scaled load to ensure that we consider the cpu power in addition to the
actual load on that cpu, so that we can move the load away from the
guy that is getting most hammered with respect to the actual capacity,
as compared with the rest of the cpu's in that busiest group.

Fix it.

Reported-by: Ma Ling &lt;ling.ma@intel.com&gt;
Initial-Analysis-by: Zhang, Yanmin &lt;yanmin_zhang@linux.intel.com&gt;
Signed-off-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;1266023662.2808.118.camel@sbs-t61.sc.intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sched: Fix missing sched tunable recalculation on cpu add/remove</title>
<updated>2010-01-28T23:01:11Z</updated>
<author>
<name>Christian Ehrhardt</name>
<email>ehrhardt@linux.vnet.ibm.com</email>
</author>
<published>2009-11-30T11:16:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=db47a1671a787a27a6f9ef780f1865fa4372f361'/>
<id>urn:sha1:db47a1671a787a27a6f9ef780f1865fa4372f361</id>
<content type='text'>
commit 0bcdcf28c979869f44e05121b96ff2cfb05bd8e6 upstream.

Based on Peter Zijlstras patch suggestion this enables recalculation of
the scheduler tunables in response of a change in the number of cpus. It
also adds a max of eight cpus that are considered in that scaling.

Signed-off-by: Christian Ehrhardt &lt;ehrhardt@linux.vnet.ibm.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;1259579808-11357-2-git-send-email-ehrhardt@linux.vnet.ibm.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>sched: Fix isolcpus boot option</title>
<updated>2010-01-28T23:01:09Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2009-12-02T03:39:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=08b84be9e906f97340acbf6c5daaa53bbf4fa194'/>
<id>urn:sha1:08b84be9e906f97340acbf6c5daaa53bbf4fa194</id>
<content type='text'>
commit bdddd2963c0264c56f18043f6fa829d3c1d3d1c0 upstream.

Anton Blanchard wrote:

&gt; We allocate and zero cpu_isolated_map after the isolcpus
&gt; __setup option has run. This means cpu_isolated_map always
&gt; ends up empty and if CPUMASK_OFFSTACK is enabled we write to a
&gt; cpumask that hasn't been allocated.

I introduced this regression in 49557e620339cb13 (sched: Fix
boot crash by zalloc()ing most of the cpu masks).

Use the bootmem allocator if they set isolcpus=, otherwise
allocate and zero like normal.

Reported-by: Anton Blanchard &lt;anton@samba.org&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: peterz@infradead.org
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: &lt;stable@kernel.org&gt;
LKML-Reference: &lt;200912021409.17013.rusty@rustcorp.com.au&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Tested-by: Anton Blanchard &lt;anton@samba.org&gt;

</content>
</entry>
<entry>
<title>sched: Fix task priority bug</title>
<updated>2010-01-22T23:18:40Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2009-12-04T08:59:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=26931397cc71bcac187efdcd2fc43ce0d41e4eb0'/>
<id>urn:sha1:26931397cc71bcac187efdcd2fc43ce0d41e4eb0</id>
<content type='text'>
commit 57785df5ac53c70da9fb53696130f3c551bfe1f9 upstream.

83f9ac removed a call to effective_prio() in wake_up_new_task(), which
leads to tasks running at MAX_PRIO.

This is caused by the idle thread being set to MAX_PRIO before forking
off init. O(1) used that to make sure idle was always preempted, CFS
uses check_preempt_curr_idle() for that so we can savely remove this bit
of legacy code.

Reported-by: Mike Galbraith &lt;efault@gmx.de&gt;
Tested-by: Mike Galbraith &lt;efault@gmx.de&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;1259754383.4003.610.camel@laptop&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>sched: Sched_rt_periodic_timer vs cpu hotplug</title>
<updated>2010-01-06T23:05:17Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2009-11-16T09:28:09Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fc310225dfa4d0ca5e8d1bfe66d49367d3e1d81a'/>
<id>urn:sha1:fc310225dfa4d0ca5e8d1bfe66d49367d3e1d81a</id>
<content type='text'>
commit 047106adcc85e3023da210143a6ab8a55df9e0fc upstream.

Heiko reported a case where a timer interrupt managed to
reference a root_domain structure that was already freed by a
concurrent hot-un-plug operation.

Solve this like the regular sched_domain stuff is also
synchronized, by adding a synchronize_sched() stmt to the free
path, this ensures that a root_domain stays present for any
atomic section that could have observed it.

Reported-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Gregory Haskins &lt;ghaskins@novell.com&gt;
Cc: Siddha Suresh B &lt;suresh.b.siddha@intel.com&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
LKML-Reference: &lt;1258363873.26714.83.camel@laptop&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>sched: Fix balance vs hotplug race</title>
<updated>2010-01-06T23:04:49Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2009-11-25T12:31:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a09adfeb9ea89d22c301749a87480ac98edc2cce'/>
<id>urn:sha1:a09adfeb9ea89d22c301749a87480ac98edc2cce</id>
<content type='text'>
commit 6ad4c18884e864cf4c77f9074d3d1816063f99cd upstream.

Since (e761b77: cpu hotplug, sched: Introduce cpu_active_map and redo
sched domain managment) we have cpu_active_mask which is suppose to rule
scheduler migration and load-balancing, except it never (fully) did.

The particular problem being solved here is a crash in try_to_wake_up()
where select_task_rq() ends up selecting an offline cpu because
select_task_rq_fair() trusts the sched_domain tree to reflect the
current state of affairs, similarly select_task_rq_rt() trusts the
root_domain.

However, the sched_domains are updated from CPU_DEAD, which is after the
cpu is taken offline and after stop_machine is done. Therefore it can
race perfectly well with code assuming the domains are right.

Cure this by building the domains from cpu_active_mask on
CPU_DOWN_PREPARE.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;new-submission&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Holger Hoffstätte &lt;holger.hoffstaette@googlemail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sched: Fix task_hot() test order</title>
<updated>2010-01-06T23:03:18Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2009-12-16T17:04:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=14ae08205860c0a902639ed2c0a601eef9c6d171'/>
<id>urn:sha1:14ae08205860c0a902639ed2c0a601eef9c6d171</id>
<content type='text'>
commit e6c8fba7771563b2f3dfb96a78f36ec17e15bdf0 upstream.

Make sure not to access sched_fair fields before verifying it is
indeed a sched_fair task.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
LKML-Reference: &lt;20091216170517.577998058@chello.nl&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>sched: Fix and clean up rate-limit newidle code</title>
<updated>2009-12-18T22:03:14Z</updated>
<author>
<name>Mike Galbraith</name>
<email>efault@gmx.de</email>
</author>
<published>2009-11-10T02:50:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=35c1ee3e78766d5666f418af638def9c67e63ecb'/>
<id>urn:sha1:35c1ee3e78766d5666f418af638def9c67e63ecb</id>
<content type='text'>
commit eae0c9dfb534cb3449888b9601228efa6480fdb5 upstream.

Commit 1b9508f, "Rate-limit newidle" has been confirmed to fix
the netperf UDP loopback regression reported by Alex Shi.

This is a cleanup and a fix:

 - moved to a more out of the way spot

 - fix to ensure that balancing doesn't try to balance
   runqueues which haven't gone online yet, which can
   mess up CPU enumeration during boot.

Reported-by: Alex Shi &lt;alex.shi@intel.com&gt;
Reported-by: Zhang, Yanmin &lt;yanmin_zhang@linux.intel.com&gt;
Signed-off-by: Mike Galbraith &lt;efault@gmx.de&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;1257821402.5648.17.camel@marge.simson.net&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
</feed>
