Skip to content

Commit

Permalink
sched: improve prev_sum_exec_runtime setting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Sep 5, 2007
1 parent 7c92e54 commit 4a55b45
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,8 @@ __check_preempt_curr_fair(struct cfs_rq *cfs_rq, struct sched_entity *se,
* preempt the current task unless the best task has
* a larger than sched_granularity fairness advantage:
*/
if (__delta > niced_granularity(curr, granularity)) {
if (__delta > niced_granularity(curr, granularity))
resched_task(rq_of(cfs_rq)->curr);
curr->prev_sum_exec_runtime = curr->sum_exec_runtime;
}
}

static inline void
Expand All @@ -703,6 +701,7 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
update_stats_wait_end(cfs_rq, se);
update_stats_curr_start(cfs_rq, se);
set_cfs_rq_curr(cfs_rq, se);
se->prev_sum_exec_runtime = se->sum_exec_runtime;
}

static struct sched_entity *pick_next_entity(struct cfs_rq *cfs_rq)
Expand Down

0 comments on commit 4a55b45

Please sign in to comment.