lkml.org 
[lkml]   [2011]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: sched: Avoid SMT siblings in select_idle_sibling() if possible
From
Date
On Thu, 2011-11-17 at 16:38 +0100, Mike Galbraith wrote:
> On Thu, 2011-11-17 at 02:59 +0100, Mike Galbraith wrote:
> > On Wed, 2011-11-16 at 10:37 -0800, Suresh Siddha wrote:
>
> > > It should be ok. Isn't it?
> >
> > Nope, wasn't ok.
>
> Because you can't get to again: with a single E5620 package, it having
> only SIBLING and MC domains.
>
> again:
> for_each_domain(target, sd) {
> if (!smt && (sd->flags & SD_SHARE_CPUPOWER))
> continue;
>
> if (!(sd->flags & SD_SHARE_PKG_RESOURCES)) {
> if (!smt) {
> smt = 1;
> goto again;
>

D'0h, indeed..

Something like the below maybe, although I'm certain it all can be
written much nicer indeed.

---
kernel/sched/fair.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index cd3b642..340e62e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2676,13 +2676,11 @@ static int select_idle_sibling(struct task_struct *p, int target)
if (!smt && (sd->flags & SD_SHARE_CPUPOWER))
continue;

- if (!(sd->flags & SD_SHARE_PKG_RESOURCES)) {
- if (!smt) {
- smt = 1;
- goto again;
- }
+ if (smt && !(sd->flags & SD_SHARE_CPUPOWER))
+ break;
+
+ if (!(sd->flags & SD_SHARE_PKG_RESOURCES))
break;
- }

sg = sd->groups;
do {
@@ -2702,6 +2700,10 @@ static int select_idle_sibling(struct task_struct *p, int target)
sg = sg->next;
} while (sg != sd->groups);
}
+ if (!smt) {
+ smt = 1;
+ goto again;
+ }
done:
rcu_read_unlock();




\
 
 \ /
  Last update: 2011-11-17 16:57    [W:0.199 / U:1.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site