From: Peter Zijlstra <peterz@infradead.org>
To: Ingo Molnar <mingo@kernel.org>, Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: linux-kernel@vger.kernel.org, Mike Galbraith <efault@gmx.de>,
Paul Turner <pjt@google.com>, Alex Shi <alex.shi@intel.com>,
Preeti U Murthy <preeti@linux.vnet.ibm.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Morten Rasmussen <morten.rasmussen@arm.com>,
Namhyung Kim <namhyung@kernel.org>, Lei Wen <leiwen@marvell.com>,
Rik van Riel <riel@surriel.com>, Joonsoo Kim <js1304@gmail.com>,
Peter Zijlstra <peterz@infradead.org>
Subject: [PATCH 09/10] sched, fair: Fix the sd_parent_degenerate() code
Date: Mon, 19 Aug 2013 18:01:07 +0200 [thread overview]
Message-ID: <20130819160425.672255367@infradead.org> (raw)
In-Reply-To: 20130819160058.539049611@infradead.org
[-- Attachment #1: peterz-fix-sd_degenerate.patch --]
[-- Type: text/plain, Size: 2587 bytes --]
I found that on my wsm box I had a redundant domain:
[ 0.949769] CPU0 attaching sched-domain:
[ 0.953765] domain 0: span 0,12 level SIBLING
[ 0.958335] groups: 0 (cpu_power = 587) 12 (cpu_power = 588)
[ 0.964548] domain 1: span 0-5,12-17 level MC
[ 0.969206] groups: 0,12 (cpu_power = 1175) 1,13 (cpu_power = 1176) 2,14 (cpu_power = 1176) 3,15 (cpu_power = 1176) 4,16 (cpu_power = 1176) 5,17 (cpu_power = 1176)
[ 0.984993] domain 2: span 0-5,12-17 level CPU
[ 0.989822] groups: 0-5,12-17 (cpu_power = 7055)
[ 0.995049] domain 3: span 0-23 level NUMA
[ 0.999620] groups: 0-5,12-17 (cpu_power = 7055) 6-11,18-23 (cpu_power = 7056)
Note how domain 2 has only a single group and spans the same CPUs as
domain 1. We should not keep such domains and do in fact have code to
prune these.
It turns out that the 'new' SD_PREFER_SIBLING flag causes this, it
makes sd_parent_degenerate() fail on the CPU domain. We can easily fix
this by 'ignoring' the SD_PREFER_SIBLING bit and transfering it to
whatever domain ends up covering the span.
With this patch the domains now look like this:
[ 0.950419] CPU0 attaching sched-domain:
[ 0.954454] domain 0: span 0,12 level SIBLING
[ 0.959039] groups: 0 (cpu_power = 587) 12 (cpu_power = 588)
[ 0.965271] domain 1: span 0-5,12-17 level MC
[ 0.969936] groups: 0,12 (cpu_power = 1175) 1,13 (cpu_power = 1176) 2,14 (cpu_power = 1176) 3,15 (cpu_power = 1176) 4,16 (cpu_power = 1176) 5,17 (cpu_power = 1176)
[ 0.985737] domain 2: span 0-23 level NUMA
[ 0.990231] groups: 0-5,12-17 (cpu_power = 7055) 6-11,18-23 (cpu_power = 7056)
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
---
kernel/sched/core.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4948,7 +4948,8 @@ sd_parent_degenerate(struct sched_domain
SD_BALANCE_FORK |
SD_BALANCE_EXEC |
SD_SHARE_CPUPOWER |
- SD_SHARE_PKG_RESOURCES);
+ SD_SHARE_PKG_RESOURCES |
+ SD_PREFER_SIBLING);
if (nr_node_ids == 1)
pflags &= ~SD_SERIALIZE;
}
@@ -5157,6 +5158,13 @@ cpu_attach_domain(struct sched_domain *s
tmp->parent = parent->parent;
if (parent->parent)
parent->parent->child = tmp;
+ /*
+ * Transfer SD_PREFER_SIBLING down in case of a
+ * degenerate parent; the spans match for this
+ * so the property transfers.
+ */
+ if (parent->flags & SD_PREFER_SIBLING)
+ tmp->flags |= SD_PREFER_SIBLING;
destroy_sched_domain(parent, cpu);
} else
tmp = tmp->parent;
next prev parent reply other threads:[~2013-08-19 16:14 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-19 16:00 [PATCH 00/10] Various load-balance cleanups/optimizations -v2 Peter Zijlstra
2013-08-19 16:00 ` [PATCH 01/10] sched: Remove one division operation in find_busiest_queue() Peter Zijlstra
2013-08-22 8:58 ` Paul Turner
2013-08-22 10:25 ` Peter Zijlstra
2013-08-19 16:01 ` [PATCH 02/10] sched: Factor out code to should_we_balance() Peter Zijlstra
2013-08-22 9:58 ` Paul Turner
2013-08-22 10:42 ` Peter Zijlstra
2013-08-23 4:51 ` Joonsoo Kim
2013-08-23 11:37 ` Paul Turner
2013-08-19 16:01 ` [PATCH 03/10] sched: Clean-up struct sd_lb_stat Peter Zijlstra
2013-08-24 10:09 ` Paul Turner
2013-08-26 11:38 ` Peter Zijlstra
2013-08-26 2:56 ` Lei Wen
2013-08-26 4:36 ` Paul Turner
2013-08-26 8:42 ` Lei Wen
2013-08-19 16:01 ` [PATCH 04/10] sched, fair: Shrink sg_lb_stats and play memset games Peter Zijlstra
2013-08-21 2:08 ` Joonsoo Kim
2013-08-21 2:20 ` Joonsoo Kim
2013-08-21 8:38 ` Peter Zijlstra
2013-08-21 8:35 ` Peter Zijlstra
2013-08-24 10:15 ` Paul Turner
2013-08-26 11:46 ` Peter Zijlstra
2013-08-19 16:01 ` [PATCH 05/10] sched, fair: Remove duplicate load_per_task computations Peter Zijlstra
2013-08-19 16:01 ` [PATCH 06/10] sched, fair: Make group power more consitent Peter Zijlstra
2013-08-23 3:40 ` Preeti U Murthy
2013-08-19 16:01 ` [PATCH 07/10] sched, fair: Optimize find_busiest_queue() Peter Zijlstra
2013-08-23 8:11 ` Preeti U Murthy
2013-08-23 10:03 ` Peter Zijlstra
2013-08-23 10:54 ` Preeti U Murthy
2013-08-24 10:33 ` Paul Turner
2013-08-26 12:07 ` Peter Zijlstra
2013-08-27 9:13 ` Paul Turner
2013-08-19 16:01 ` [PATCH 08/10] sched, fair: Rework and comment the group_imb code Peter Zijlstra
2013-08-19 16:01 ` Peter Zijlstra [this message]
2013-08-24 10:45 ` [PATCH 09/10] sched, fair: Fix the sd_parent_degenerate() code Paul Turner
2013-08-26 12:09 ` Peter Zijlstra
2013-08-26 21:49 ` Rik van Riel
2013-08-27 9:05 ` Paul Turner
2013-08-19 16:01 ` [RFC][PATCH 10/10] sched, fair: Rewrite group_imb trigger Peter Zijlstra
2013-08-21 2:09 ` [PATCH 00/10] Various load-balance cleanups/optimizations -v2 Joonsoo Kim
2013-08-28 8:55 ` [RFC][PATCH 11/10] sched, fair: Reduce local_group logic Peter Zijlstra
2013-08-28 8:57 ` Peter Zijlstra
2013-08-28 9:16 ` Peter Zijlstra
2013-08-28 11:14 ` [PATCH 12/10] sched, fair: Fix group power_orig computation Peter Zijlstra
2013-08-28 11:15 ` [PATCH 13/10] sched, fair: Rework and comment the group_capacity code Peter Zijlstra
2013-08-28 11:16 ` [RFC][PATCH 14/10] sched, fair: Fix the group_capacity computation Peter Zijlstra
2013-09-04 7:44 ` Vincent Guittot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130819160425.672255367@infradead.org \
--to=peterz@infradead.org \
--cc=alex.shi@intel.com \
--cc=efault@gmx.de \
--cc=iamjoonsoo.kim@lge.com \
--cc=js1304@gmail.com \
--cc=leiwen@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=morten.rasmussen@arm.com \
--cc=namhyung@kernel.org \
--cc=pjt@google.com \
--cc=preeti@linux.vnet.ibm.com \
--cc=riel@surriel.com \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox