All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Kyle Moffett <mrmacman_g4@mac.com>
Cc: Roman Zippel <zippel@linux-m68k.org>, Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, Mike Galbraith <efault@gmx.de>
Subject: Re: [announce] CFS-devel, performance improvements
Date: Thu, 13 Sep 2007 21:08:50 +0200	[thread overview]
Message-ID: <1189710530.5643.8.camel@lappy> (raw)
In-Reply-To: <D1C6ACC2-FD90-4813-84C9-A23531684B86@mac.com>

On Thu, 2007-09-13 at 14:28 -0400, Kyle Moffett wrote:

>  with the exception of one patch that's missing a changelog entry.

Ah, that would have been one of mine.

---
From: Peter Zijlstra <a.p.zijlstra@chello.nl>

Handle vruntime overflow by centering the key space around min_vruntime.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
     kernel/sched_fair.c |   15 +++++++++++----
     1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index a306f05..b8e2a0d 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -116,11 +116,18 @@ set_leftmost(struct cfs_rq *cfs_rq, struct rb_node *leftmost)
 	cfs_rq->rb_leftmost = leftmost;
 	if (leftmost) {
 		se = rb_entry(leftmost, struct sched_entity, run_node);
-		cfs_rq->min_vruntime = max(se->vruntime,
-						cfs_rq->min_vruntime);
+		if ((se->vruntime > cfs_rq->min_vruntime) ||
+		    (cfs_rq->min_vruntime > (1ULL << 61) &&
+		     se->vruntime < (1ULL << 50)))
+			cfs_rq->min_vruntime = se->vruntime;
 	}
 }
 
+s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se)
+{
+	return se->fair_key - cfs_rq->min_vruntime;
+}
+
 /*
  * Enqueue an entity into the rb-tree:
  */
@@ -130,7 +137,7 @@ __enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
 	struct rb_node **link = &cfs_rq->tasks_timeline.rb_node;
 	struct rb_node *parent = NULL;
 	struct sched_entity *entry;
-	s64 key = se->fair_key;
+	s64 key = entity_key(cfs_rq, se);
 	int leftmost = 1;
 
 	/*
@@ -143,7 +150,7 @@ __enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
 		 * We dont care about collisions. Nodes with
 		 * the same key stay together.
 		 */
-		if (key - entry->fair_key < 0) {
+		if (key < entity_key(cfs_rq, entry)) {
 			link = &parent->rb_left;
 		} else {
 			link = &parent->rb_right;



  reply	other threads:[~2007-09-13 19:09 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-11 20:04 [announce] CFS-devel, performance improvements Ingo Molnar
2007-09-12  0:42 ` Roman Zippel
2007-09-13  7:52   ` Ingo Molnar
2007-09-13 12:35     ` Roman Zippel
2007-09-13 14:28       ` Ingo Molnar
2007-09-13 16:50         ` Roman Zippel
2007-09-13 17:06           ` Peter Zijlstra
2007-09-13 17:09             ` Peter Zijlstra
2007-09-14 12:04             ` Roman Zippel
2007-09-14 12:17               ` Peter Zijlstra
2007-09-13 18:28           ` Kyle Moffett
2007-09-13 19:08             ` Peter Zijlstra [this message]
2007-09-14 15:26           ` Arjan van de Ven
2007-09-14 14:50             ` Roman Zippel
2007-09-14 15:56               ` Arjan van de Ven
2007-09-14 15:13                 ` Roman Zippel
2007-09-13 19:01       ` Sam Ravnborg
2007-09-14 12:26         ` Roman Zippel
2007-09-12  1:16 ` Rob Hussey
2007-09-13  8:42   ` Rob Hussey
2007-09-13  9:06     ` Ingo Molnar
2007-09-13  9:24       ` Rob Hussey
2007-09-13  9:31         ` Ingo Molnar
2007-09-13  9:36           ` Rob Hussey
2007-09-13  9:43             ` Rob Hussey
2007-09-13 10:17               ` Rob Hussey
2007-09-13 11:48             ` Ingo Molnar
2007-09-14  1:47               ` Rob Hussey
2007-09-14  2:26                 ` Rob Hussey
2007-09-14  6:59                 ` Kyle Moffett
2007-09-12  6:20 ` Mike Galbraith
2007-09-12 22:17 ` Roman Zippel
2007-09-13  7:17   ` debian developer
2007-09-13  7:34   ` debian developer
2007-09-13  9:19   ` Ingo Molnar
2007-09-13 11:35   ` Peter Zijlstra
2007-09-13 12:14     ` Roman Zippel
2007-09-13 12:44       ` Peter Zijlstra
2007-09-14 11:16         ` Peter Zijlstra
2007-09-13 12:47   ` Ingo Molnar
2007-09-14 11:46     ` Roman Zippel
2007-09-13 23:08   ` Willy Tarreau
2007-09-14 13:10     ` Roman Zippel
2007-09-14 17:54       ` Willy Tarreau
  -- strict thread matches above, loose matches on Subject: below --
2007-09-13 22:51 dimm
2007-09-14  8:13 ` Ingo Molnar
2007-09-14  8:13 ` Ingo Molnar
2007-09-13 23:25 dimm
2007-09-14  8:17 ` Ingo Molnar

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=1189710530.5643.8.camel@lappy \
    --to=a.p.zijlstra@chello.nl \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mrmacman_g4@mac.com \
    --cc=zippel@linux-m68k.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.