diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2007-09-05 08:32:49 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-09-05 08:32:49 -0400 |
commit | 4a55b45036a677fac43fe81ddf7fdcd007aaaee7 (patch) | |
tree | 86558fa9997e28194d84b997011ed91cde49746c /kernel/sched_fair.c | |
parent | 7c92e54f6f9601cfa9d8894ee248abcf62ed9a1c (diff) |
sched: improve prev_sum_exec_runtime setting
Second preparatory patch for fix-ideal runtime:
Mark prev_sum_exec_runtime at the beginning of our run, the same spot
that adds our wait period to wait_runtime. This seems a more natural
location to do this, and it also reduces the code a bit:
text data bss dec hex filename
13397 228 1204 14829 39ed sched.o.before
13391 228 1204 14823 39e7 sched.o.after
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | kernel/sched_fair.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index f0dd4be1a3a..2d01bbc2d04 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -684,10 +684,8 @@ __check_preempt_curr_fair(struct cfs_rq *cfs_rq, struct sched_entity *se, | |||
684 | * preempt the current task unless the best task has | 684 | * preempt the current task unless the best task has |
685 | * a larger than sched_granularity fairness advantage: | 685 | * a larger than sched_granularity fairness advantage: |
686 | */ | 686 | */ |
687 | if (__delta > niced_granularity(curr, granularity)) { | 687 | if (__delta > niced_granularity(curr, granularity)) |
688 | resched_task(rq_of(cfs_rq)->curr); | 688 | resched_task(rq_of(cfs_rq)->curr); |
689 | curr->prev_sum_exec_runtime = curr->sum_exec_runtime; | ||
690 | } | ||
691 | } | 689 | } |
692 | 690 | ||
693 | static inline void | 691 | static inline void |
@@ -703,6 +701,7 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se) | |||
703 | update_stats_wait_end(cfs_rq, se); | 701 | update_stats_wait_end(cfs_rq, se); |
704 | update_stats_curr_start(cfs_rq, se); | 702 | update_stats_curr_start(cfs_rq, se); |
705 | set_cfs_rq_curr(cfs_rq, se); | 703 | set_cfs_rq_curr(cfs_rq, se); |
704 | se->prev_sum_exec_runtime = se->sum_exec_runtime; | ||
706 | } | 705 | } |
707 | 706 | ||
708 | static struct sched_entity *pick_next_entity(struct cfs_rq *cfs_rq) | 707 | static struct sched_entity *pick_next_entity(struct cfs_rq *cfs_rq) |