linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched/fair: Skip wake_affine() for core siblings
@ 2015-09-25 17:54 Kirill Tkhai
  2015-09-26 15:25 ` Mike Galbraith
  0 siblings, 1 reply; 14+ messages in thread
From: Kirill Tkhai @ 2015-09-25 17:54 UTC (permalink / raw)
  To: linux-kernel, Peter Zijlstra, Ingo Molnar

We are not interested in actual target if both prev
and curr cpus share CPU cache. select_idle_sibling()
searches in top-down order; top level is the same
for both of them, and the result will be the same.
So, we can save a little CPU cycles and cache misses
and skip wake_affine() calculations.

tbench on 2 physical CPU Xeon (x 6 cores x 2 ht) inside cgroup:

threads  | Before         |  After
-------------------------------------------
      1  | 203.943 MB/sec |  211.524 MB/sec
      2  | 407.211 MB/sec |  411.701 MB/sec
      3  | 591.089 MB/sec |  608.404 MB/sec
      4  | 743.768 MB/sec |  790.026 MB/sec (+ 6.2%)
      5  | 914.237 MB/sec |  972.882 MB/sec (+ 6.4%)
      6  | 1053.91 MB/sec |  1092.81 MB/sec
      7  | 1208.24 MB/sec |  1281.1 MB/sec  (+ 6.0%)
      8  | 1357.53 MB/sec |  1385.79 MB/sec
      9  | 1474.11 MB/sec |  1496.76 MB/sec
     10  | 1586.89 MB/sec |  1616.76 MB/sec
     11  | 1720.17 MB/sec |  1732.7 MB/sec
     12  | 1835.4 MB/sec  |  1868.77 MB/sec
     13  | 1964.76 MB/sec |  2003.68 MB/sec
     14  | 2117.01 MB/sec |  2128.16 MB/sec
     15  | 2220.97 MB/sec |  2254.8 MB/sec
     16  | 2326.52 MB/sec |  2378.38 MB/sec
     17  | 2458.79 MB/sec |  2484.15 MB/sec
     18  | 2473.59 MB/sec |  2591.01 MB/sec (+ 4.7%)

Signed-off-by: Kirill Tkhai <ktkhai@odin.com>
---
 kernel/sched/fair.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 4df37a4..b378c34 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4666,6 +4666,9 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync)
 	unsigned long weight;
 	int balanced;
 
+	if (sd->flags & SD_SHARE_PKG_RESOURCES)
+		return 1;
+
 	idx	  = sd->wake_idx;
 	this_cpu  = smp_processor_id();
 	prev_cpu  = task_cpu(p);


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-09-30 19:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-25 17:54 [PATCH] sched/fair: Skip wake_affine() for core siblings Kirill Tkhai
2015-09-26 15:25 ` Mike Galbraith
2015-09-28 10:28   ` Kirill Tkhai
2015-09-28 13:12     ` Mike Galbraith
2015-09-28 15:36       ` Kirill Tkhai
2015-09-28 15:49         ` Kirill Tkhai
2015-09-28 18:22         ` Mike Galbraith
2015-09-28 19:19           ` Kirill Tkhai
2015-09-29  2:03             ` Mike Galbraith
2015-09-29 14:55         ` Mike Galbraith
2015-09-29 16:00           ` Kirill Tkhai
2015-09-29 16:03             ` Kirill Tkhai
2015-09-29 17:29             ` Mike Galbraith
2015-09-30 19:16               ` Kirill Tkhai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).