History

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

Peter Zijlstra committed 19 years ago

Commit 4a55b451 parent 7c92e541 file · +2 −3Browse files

Unified · Split

kernel/sched_fair.c+2−3
@@ -684,10 +684,8 @@ __check_preempt_curr_fair(struct cfs_rq *cfs_rq, struct sched_entity *se, · 683 unmodified lines
684684 * preempt the current task unless the best task has
685685 * a larger than sched_granularity fairness advantage:
686686 */
687− if (__delta > niced_granularity(curr, granularity)) {
687+ if (__delta > niced_granularity(curr, granularity))
688688 resched_task(rq_of(cfs_rq)->curr);
689− curr->prev_sum_exec_runtime = curr->sum_exec_runtime;
690− }
691689 }
692690
693691 static inline void
@@ -703,6 +701,7 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se) · 9 unmodified lines
703701 update_stats_wait_end(cfs_rq, se);
704702 update_stats_curr_start(cfs_rq, se);
705703 set_cfs_rq_curr(cfs_rq, se);
704+ se->prev_sum_exec_runtime = se->sum_exec_runtime;
706705 }
707706
708707 static struct sched_entity *pick_next_entity(struct cfs_rq *cfs_rq)