diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-08-12 12:08:19 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-08-12 12:08:19 -0400 |
commit | 5d2b3d3695a841231b65b5536a70dc29961c5611 (patch) | |
tree | eac6ed4b85734714b308f7f8b70ace62efb631ac /kernel/sched_fair.c | |
parent | 6707de00fdec3e3225192fe3dcd21323a8936b1f (diff) |
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 <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | 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 c5af38948a1e..fedbb51bba96 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -75,7 +75,7 @@ enum { | |||
75 | 75 | ||
76 | unsigned int sysctl_sched_features __read_mostly = | 76 | unsigned int sysctl_sched_features __read_mostly = |
77 | SCHED_FEAT_FAIR_SLEEPERS *1 | | 77 | SCHED_FEAT_FAIR_SLEEPERS *1 | |
78 | SCHED_FEAT_SLEEPER_AVG *1 | | 78 | SCHED_FEAT_SLEEPER_AVG *0 | |
79 | SCHED_FEAT_SLEEPER_LOAD_AVG *1 | | 79 | SCHED_FEAT_SLEEPER_LOAD_AVG *1 | |
80 | SCHED_FEAT_PRECISE_CPU_LOAD *1 | | 80 | SCHED_FEAT_PRECISE_CPU_LOAD *1 | |
81 | SCHED_FEAT_START_DEBIT *1 | | 81 | SCHED_FEAT_START_DEBIT *1 | |
@@ -304,11 +304,9 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr) | |||
304 | delta_mine = calc_delta_mine(delta_exec, curr->load.weight, lw); | 304 | delta_mine = calc_delta_mine(delta_exec, curr->load.weight, lw); |
305 | 305 | ||
306 | if (cfs_rq->sleeper_bonus > sysctl_sched_granularity) { | 306 | if (cfs_rq->sleeper_bonus > sysctl_sched_granularity) { |
307 | delta = calc_delta_mine(cfs_rq->sleeper_bonus, | 307 | delta = min(cfs_rq->sleeper_bonus, (u64)delta_exec); |
308 | curr->load.weight, lw); | 308 | delta = calc_delta_mine(delta, curr->load.weight, lw); |
309 | if (unlikely(delta > cfs_rq->sleeper_bonus)) | 309 | delta = min((u64)delta, cfs_rq->sleeper_bonus); |
310 | delta = cfs_rq->sleeper_bonus; | ||
311 | |||
312 | cfs_rq->sleeper_bonus -= delta; | 310 | cfs_rq->sleeper_bonus -= delta; |
313 | delta_mine -= delta; | 311 | delta_mine -= delta; |
314 | } | 312 | } |
@@ -521,6 +519,8 @@ static void __enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se) | |||
521 | * Track the amount of bonus we've given to sleepers: | 519 | * Track the amount of bonus we've given to sleepers: |
522 | */ | 520 | */ |
523 | cfs_rq->sleeper_bonus += delta_fair; | 521 | cfs_rq->sleeper_bonus += delta_fair; |
522 | if (unlikely(cfs_rq->sleeper_bonus > sysctl_sched_runtime_limit)) | ||
523 | cfs_rq->sleeper_bonus = sysctl_sched_runtime_limit; | ||
524 | 524 | ||
525 | schedstat_add(cfs_rq, wait_runtime, se->wait_runtime); | 525 | schedstat_add(cfs_rq, wait_runtime, se->wait_runtime); |
526 | } | 526 | } |