Skip to content

Commit

Permalink
sched: Fix variable name misnomer, add comments
Browse files Browse the repository at this point in the history
The min_vruntime variable actually stores the maximum value.
The added comment was taken from place_entity function.

Signed-off-by: Andrei Epure <epure.andrei@gmail.com>
Cc: peterz@infradead.org
Link: http://lkml.kernel.org/r/1363115544-1964-1-git-send-email-epure.andrei@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Andrei Epure authored and Ingo Molnar committed Mar 14, 2013
1 parent 660cc00 commit 1bf0823
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,13 @@ void account_cfs_rq_runtime(struct cfs_rq *cfs_rq, unsigned long delta_exec);
* Scheduling class tree data structure manipulation methods:
*/

static inline u64 max_vruntime(u64 min_vruntime, u64 vruntime)
static inline u64 max_vruntime(u64 max_vruntime, u64 vruntime)
{
s64 delta = (s64)(vruntime - min_vruntime);
s64 delta = (s64)(vruntime - max_vruntime);
if (delta > 0)
min_vruntime = vruntime;
max_vruntime = vruntime;

return min_vruntime;
return max_vruntime;
}

static inline u64 min_vruntime(u64 min_vruntime, u64 vruntime)
Expand Down Expand Up @@ -473,6 +473,7 @@ static void update_min_vruntime(struct cfs_rq *cfs_rq)
vruntime = min_vruntime(vruntime, se->vruntime);
}

/* ensure we never gain time by being placed backwards. */
cfs_rq->min_vruntime = max_vruntime(cfs_rq->min_vruntime, vruntime);
#ifndef CONFIG_64BIT
smp_wmb();
Expand Down

0 comments on commit 1bf0823

Please sign in to comment.