From: Ingo Molnar <mingo@elte.hu>
To: Pawel Dziekonski <dzieko@gmail.com>, Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>, linux-kernel@vger.kernel.org
Subject: Re: CPU scheduler question/problem
Date: Mon, 26 Jan 2009 23:55:45 +0100 [thread overview]
Message-ID: <20090126225545.GA1330@elte.hu> (raw)
In-Reply-To: <2cd4df870901260548s2376a01anae0db9707dcfa14@mail.gmail.com>
* Pawel Dziekonski <dzieko@gmail.com> wrote:
> 2009/1/23 Peter Zijlstra <peterz@infradead.org>:
>
> > The pipe workload you mentioned has would behave that way because pipes
> > 'assume' a produces/consumer behaviour, and thus are more likely to
> > place both tasks on the same cpu -- but will eventually pull them apart
> > if they want to run concurrently.
> >
> > You might enable SCHED_DEBUG=y and try
> > echo NO_SYNC_WAKEUPS > /debug/sched_features
>
> Hello,
>
> that did the trick. Openssl now gets a whole core exclusively and gives
> full performance.
>
> Regarding quantum chemistry application -- it is also using pipes for
> communication between worker processes. Now this app works OK.
Could you please try the fuller fix below too please, does it still do the
trick and does the scheduler still maximize openssl and your quantum
chemistry app's throughput?
There should be no need for you to tune anything - the scheduler must get
such workloads right out of the box.
Ingo
--------------------------->
>From 08a1c2658637045d207b6fa0c328055e589a4009 Mon Sep 17 00:00:00 2001
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
Date: Mon, 26 Jan 2009 17:56:17 +0100
Subject: [PATCH] sched: disable sync wakeups
Pawel Dziekonski reported that the openssl benchmark and his
quantum chemistry application both show slowdowns due to the
scheduler under-parallelizing execution.
The reason are pipe wakeups still doing 'sync' wakeups which
overrides the normal buddy wakeup logic - even if waker and
wakee are loosely coupled.
So disable sync wakeups and also fix an inversion of logic
in the buddy wakeup code.
Reported-by: Pawel Dziekonski <dzieko@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/sched.c | 4 ++++
kernel/sched_fair.c | 8 +-------
kernel/sched_features.h | 2 +-
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 8c2be1e..ce1cfc6 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2266,6 +2266,10 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync)
if (!sched_feat(SYNC_WAKEUPS))
sync = 0;
+ if (!sync && (current->se.avg_overlap < sysctl_sched_migration_cost &&
+ p->se.avg_overlap < sysctl_sched_migration_cost))
+ sync = 1;
+
#ifdef CONFIG_SMP
if (sched_feat(LB_WAKEUP_UPDATE)) {
struct sched_domain *sd;
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 5cc1c16..fd789a2 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1189,10 +1189,6 @@ wake_affine(struct sched_domain *this_sd, struct rq *this_rq,
if (!(this_sd->flags & SD_WAKE_AFFINE) || !sched_feat(AFFINE_WAKEUPS))
return 0;
- if (sync && (curr->se.avg_overlap > sysctl_sched_migration_cost ||
- p->se.avg_overlap > sysctl_sched_migration_cost))
- sync = 0;
-
/*
* If sync wakeup then subtract the (maximum possible)
* effect of the currently running task from the load
@@ -1419,9 +1415,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int sync)
if (!sched_feat(WAKEUP_PREEMPT))
return;
- if (sched_feat(WAKEUP_OVERLAP) && (sync ||
- (se->avg_overlap < sysctl_sched_migration_cost &&
- pse->avg_overlap < sysctl_sched_migration_cost))) {
+ if (sched_feat(WAKEUP_OVERLAP) && sync) {
resched_task(curr);
return;
}
diff --git a/kernel/sched_features.h b/kernel/sched_features.h
index da5d93b..8134e65 100644
--- a/kernel/sched_features.h
+++ b/kernel/sched_features.h
@@ -4,7 +4,7 @@ SCHED_FEAT(WAKEUP_PREEMPT, 1)
SCHED_FEAT(START_DEBIT, 1)
SCHED_FEAT(AFFINE_WAKEUPS, 1)
SCHED_FEAT(CACHE_HOT_BUDDY, 1)
-SCHED_FEAT(SYNC_WAKEUPS, 1)
+SCHED_FEAT(SYNC_WAKEUPS, 0)
SCHED_FEAT(HRTICK, 0)
SCHED_FEAT(DOUBLE_TICK, 0)
SCHED_FEAT(ASYM_GRAN, 1)
next prev parent reply other threads:[~2009-01-26 22:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-22 21:34 CPU scheduler question/problem Pawel Dziekonski
2009-01-23 15:40 ` Peter Zijlstra
2009-01-26 13:48 ` Pawel Dziekonski
2009-01-26 13:55 ` Peter Zijlstra
2009-01-26 22:55 ` Ingo Molnar [this message]
2009-01-27 16:04 ` Pawel Dziekonski
[not found] <2cd4df870902031544h5f0b4e59na2c0a0804125dd9a@mail.gmail.com>
[not found] ` <2cd4df870902040600r2974362r4e9eabf2608b05b4@mail.gmail.com>
[not found] ` <20090204142455.GE4411@elte.hu>
[not found] ` <2cd4df870902040751l19332473ic36e2642723f5ec8@mail.gmail.com>
[not found] ` <20090205192502.GC27422@elte.hu>
[not found] ` <2cd4df870902051514k31582fbal11113b37b756dda0@mail.gmail.com>
[not found] ` <1233914595.10894.1.camel@laptop>
[not found] ` <20090206155311.GQ18368@elte.hu>
[not found] ` <2cd4df870902061444p335a9433l73fe6e820ec11c6@mail.gmail.com>
[not found] ` <20090209122538.GI17782@elte.hu>
[not found] ` <2cd4df870902091056v7287e53fx8e7c8c5599b856b3@mail.gmail.com>
2009-02-11 9:06 ` Yinghai Lu
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=20090126225545.GA1330@elte.hu \
--to=mingo@elte.hu \
--cc=dzieko@gmail.com \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.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