Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b0ffd246ea947a037746e725bd461bb7e809a4b3
Commit:     b0ffd246ea947a037746e725bd461bb7e809a4b3
Parent:     2830cf8c90f37526d401f1999250312df970bfa3
Author:     Peter Zijlstra <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 15 17:00:12 2007 +0200
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Mon Oct 15 17:00:12 2007 +0200

    sched: clean up min_vruntime use
    
    clean up min_vruntime use.
    
    Signed-off-by: Peter Zijlstra <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 kernel/sched_fair.c |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index fcd6900..ec0569e 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -124,6 +124,16 @@ max_vruntime(u64 min_vruntime, u64 vruntime)
        return min_vruntime;
 }
 
+static inline u64
+min_vruntime(u64 min_vruntime, u64 vruntime)
+{
+       s64 delta = (s64)(vruntime - min_vruntime);
+       if (delta < 0)
+               min_vruntime = vruntime;
+
+       return min_vruntime;
+}
+
 static inline s64
 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se)
 {
@@ -251,7 +261,7 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity 
*curr,
              unsigned long delta_exec)
 {
        unsigned long delta_exec_weighted;
-       u64 next_vruntime, min_vruntime;
+       u64 vruntime;
 
        schedstat_set(curr->exec_max, max((u64)delta_exec, curr->exec_max));
 
@@ -269,19 +279,13 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity 
*curr,
         * value tracking the leftmost vruntime in the tree.
         */
        if (first_fair(cfs_rq)) {
-               next_vruntime = __pick_next_entity(cfs_rq)->vruntime;
-
-               /* min_vruntime() := !max_vruntime() */
-               min_vruntime = max_vruntime(curr->vruntime, next_vruntime);
-               if (min_vruntime == next_vruntime)
-                       min_vruntime = curr->vruntime;
-               else
-                       min_vruntime = next_vruntime;
+               vruntime = min_vruntime(curr->vruntime,
+                               __pick_next_entity(cfs_rq)->vruntime);
        } else
-               min_vruntime = curr->vruntime;
+               vruntime = curr->vruntime;
 
        cfs_rq->min_vruntime =
-               max_vruntime(cfs_rq->min_vruntime, min_vruntime);
+               max_vruntime(cfs_rq->min_vruntime, vruntime);
 }
 
 static void update_curr(struct cfs_rq *cfs_rq)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to