Skip to content

Commit

Permalink
sched: cleanup, make dequeue_entity() and update_stats_wait_end() sim…
Browse files Browse the repository at this point in the history
…ilar

make dequeue_entity() / enqueue_entity() and update_stats_dequeue() /
update_stats_enqueue() look similar, structure-wise.

zero effect, functionality-wise:

   text    data     bss     dec     hex filename
  34550    3026     100   37676    932c sched.o.before
  34550    3026     100   37676    932c sched.o.after

Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Dmitry Adamushko authored and Ingo Molnar committed Oct 15, 2007
1 parent a03c906 commit a2a2d68
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ update_stats_wait_end(struct cfs_rq *cfs_rq, struct sched_entity *se)
static inline void
update_stats_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
update_curr(cfs_rq);
/*
* Mark the end of the wait period if dequeueing a
* waiting task:
Expand Down Expand Up @@ -505,7 +504,7 @@ static void
enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int wakeup)
{
/*
* Update the fair clock.
* Update run-time statistics of the 'current'.
*/
update_curr(cfs_rq);

Expand All @@ -524,6 +523,11 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int wakeup)
static void
dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep)
{
/*
* Update run-time statistics of the 'current'.
*/
update_curr(cfs_rq);

update_stats_dequeue(cfs_rq, se);
if (sleep) {
#ifdef CONFIG_SCHEDSTATS
Expand Down Expand Up @@ -787,8 +791,7 @@ static void yield_task_fair(struct rq *rq)
if (likely(!sysctl_sched_compat_yield)) {
__update_rq_clock(rq);
/*
* Dequeue and enqueue the task to update its
* position within the tree:
* Update run-time statistics of the 'current'.
*/
update_curr(cfs_rq);

Expand Down

0 comments on commit a2a2d68

Please sign in to comment.