Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5d2b3d3695a841231b65b5536a70dc29961c5611
Commit:     5d2b3d3695a841231b65b5536a70dc29961c5611
Parent:     6707de00fdec3e3225192fe3dcd21323a8936b1f
Author:     Ingo Molnar <[EMAIL PROTECTED]>
AuthorDate: Sun Aug 12 18:08:19 2007 +0200
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Sun Aug 12 18:08:19 2007 +0200

    sched: fix sleeper bonus
    
    Peter Ziljstra noticed that the sleeper bonus deduction code
    was not properly rate-limited: a task that scheduled more
    frequently would get a disproportionately large deduction.
    So limit the deduction to delta_exec.
    
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 kernel/sched_fair.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index c5af389..fedbb51 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -75,7 +75,7 @@ enum {
 
 unsigned int sysctl_sched_features __read_mostly =
                SCHED_FEAT_FAIR_SLEEPERS        *1 |
-               SCHED_FEAT_SLEEPER_AVG          *1 |
+               SCHED_FEAT_SLEEPER_AVG          *0 |
                SCHED_FEAT_SLEEPER_LOAD_AVG     *1 |
                SCHED_FEAT_PRECISE_CPU_LOAD     *1 |
                SCHED_FEAT_START_DEBIT          *1 |
@@ -304,11 +304,9 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity 
*curr)
        delta_mine = calc_delta_mine(delta_exec, curr->load.weight, lw);
 
        if (cfs_rq->sleeper_bonus > sysctl_sched_granularity) {
-               delta = calc_delta_mine(cfs_rq->sleeper_bonus,
-                                       curr->load.weight, lw);
-               if (unlikely(delta > cfs_rq->sleeper_bonus))
-                       delta = cfs_rq->sleeper_bonus;
-
+               delta = min(cfs_rq->sleeper_bonus, (u64)delta_exec);
+               delta = calc_delta_mine(delta, curr->load.weight, lw);
+               delta = min((u64)delta, cfs_rq->sleeper_bonus);
                cfs_rq->sleeper_bonus -= delta;
                delta_mine -= delta;
        }
@@ -521,6 +519,8 @@ static void __enqueue_sleeper(struct cfs_rq *cfs_rq, struct 
sched_entity *se)
         * Track the amount of bonus we've given to sleepers:
         */
        cfs_rq->sleeper_bonus += delta_fair;
+       if (unlikely(cfs_rq->sleeper_bonus > sysctl_sched_runtime_limit))
+               cfs_rq->sleeper_bonus = sysctl_sched_runtime_limit;
 
        schedstat_add(cfs_rq, wait_runtime, se->wait_runtime);
 }
-
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