public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Mike Galbraith <efault@gmx.de>
Cc: Dhaval Giani <dhaval@linux.vnet.ibm.com>,
	Greg Smith <gsmith@gregsmith.com>,
	lkml <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Subject: Re: PostgreSQL pgbench performance regression in 2.6.23+
Date: Thu, 22 May 2008 14:24:41 +0200	[thread overview]
Message-ID: <1211459081.29104.40.camel@twins> (raw)
In-Reply-To: <1211458176.5693.6.camel@marge.simson.net>

On Thu, 2008-05-22 at 14:09 +0200, Mike Galbraith wrote:
> On Thu, 2008-05-22 at 13:44 +0200, Peter Zijlstra wrote:
> 
> > Humm,.. how to fix this.. we'd need to somehow detect the 1:n nature of
> > its operation - I'm sure there are other scenarios that could benefit
> > from this.
> 
> Maybe simple (minded): cache waker's last non-interrupt context wakee,
> if the wakee != cached, ignore SYNC_WAKEUP unless sync was requested at
> call time?

Yeah, something like so - or perhaps like you say cache the wakee.

I picked the wake_affine() condition, because I think that is the
biggest factor in this behaviour. You could of course also disable all
of sync.



diff --git a/include/linux/sched.h b/include/linux/sched.h
index c86c5c5..856c2a8 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -950,6 +950,8 @@ struct sched_entity {
 	u64			last_wakeup;
 	u64			avg_overlap;
 
+	struct sched_entity 	*waker;
+
 #ifdef CONFIG_SCHEDSTATS
 	u64			wait_start;
 	u64			wait_max;
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 894a702..8971044 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1036,7 +1036,8 @@ wake_affine(struct rq *rq, struct sched_domain *this_sd, struct rq *this_rq,
 	 * a reasonable amount of time then attract this newly
 	 * woken task:
 	 */
-	if (sync && curr->sched_class == &fair_sched_class) {
+	if (sync && curr->sched_class == &fair_sched_class &&
+	    p->se.waker == curr->se->waker) {
 		if (curr->se.avg_overlap < sysctl_sched_migration_cost &&
 				p->se.avg_overlap < sysctl_sched_migration_cost)
 			return 1;
@@ -1210,6 +1211,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
 	if (unlikely(se == pse))
 		return;
 
+	se->waker = pse;
 	cfs_rq_of(pse)->next = pse;
 
 	/*




  reply	other threads:[~2008-05-22 12:25 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-21 17:34 PostgreSQL pgbench performance regression in 2.6.23+ Greg Smith
2008-05-22  7:10 ` Mike Galbraith
2008-05-22  8:28   ` Dhaval Giani
2008-05-22  9:05     ` Mike Galbraith
2008-05-22 10:34       ` Mike Galbraith
2008-05-22 11:25         ` Mike Galbraith
2008-05-22 11:44           ` Peter Zijlstra
2008-05-22 12:09             ` Mike Galbraith
2008-05-22 12:24               ` Peter Zijlstra [this message]
2008-05-22 13:16                 ` Mike Galbraith
2008-05-23  7:13                 ` Greg Smith
2008-05-23 10:00                   ` Mike Galbraith
2008-05-23 10:10                     ` Ingo Molnar
2008-05-23 10:15                       ` Mike Galbraith
2008-05-23 23:18                         ` Greg Smith
2008-05-23 23:46                           ` Mike Galbraith
2008-05-24  8:08                             ` Mike Galbraith
2008-05-27  0:28                             ` Greg Smith
2008-05-27  5:59                               ` [patch] " Mike Galbraith
2008-05-27  8:20                                 ` Mike Galbraith
2008-05-27  8:35                                   ` Mike Galbraith
2008-06-06  5:03                                 ` Greg Smith
2008-06-06  6:13                                   ` Mike Galbraith
2008-06-07 11:38                                     ` Mike Galbraith
2008-06-07 12:50                                       ` Mike Galbraith
2008-06-07 13:07                                         ` Peter Zijlstra
2008-06-07 14:16                                           ` Mike Galbraith
2008-06-07 16:16                                             ` Peter Zijlstra
2008-06-07 17:56                                               ` Mike Galbraith
2008-06-07 13:08                                       ` Peter Zijlstra
2008-06-07 14:54                                         ` [patch part 2] " Mike Galbraith
2008-06-07 16:12                                           ` Peter Zijlstra
2008-06-07 17:53                                             ` Mike Galbraith
2008-06-07 18:19                                               ` Mike Galbraith
2008-05-23 13:05                       ` Mike Galbraith
2008-05-23 13:35                         ` Mike Galbraith
  -- strict thread matches above, loose matches on Subject: below --
2008-05-23 11:26 Anton Petrusevich
2008-05-23 18:46 ` Greg Smith

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=1211459081.29104.40.camel@twins \
    --to=peterz@infradead.org \
    --cc=dhaval@linux.vnet.ibm.com \
    --cc=efault@gmx.de \
    --cc=gsmith@gregsmith.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=vatsa@linux.vnet.ibm.com \
    /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