Skip to content

Commit 0429489

Browse files
vingu-linaroPeter Zijlstra
authored andcommitted
sched/fair: Fix variable declaration position
Move variable declaration at the beginning of the function Signed-off-by: Vincent Guittot <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Dietmar Eggemann <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 61b82df commit 0429489

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kernel/sched/fair.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5494,6 +5494,7 @@ static bool
54945494
dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
54955495
{
54965496
bool sleep = flags & DEQUEUE_SLEEP;
5497+
int action = UPDATE_TG;
54975498

54985499
update_curr(cfs_rq);
54995500
clear_buddies(cfs_rq, se);
@@ -5519,7 +5520,6 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
55195520
}
55205521
}
55215522

5522-
int action = UPDATE_TG;
55235523
if (entity_is_task(se) && task_on_rq_migrating(task_of(se)))
55245524
action |= DO_DETACH;
55255525

@@ -5627,6 +5627,8 @@ static int dequeue_entities(struct rq *rq, struct sched_entity *se, int flags);
56275627
static struct sched_entity *
56285628
pick_next_entity(struct rq *rq, struct cfs_rq *cfs_rq)
56295629
{
5630+
struct sched_entity *se;
5631+
56305632
/*
56315633
* Enabling NEXT_BUDDY will affect latency but not fairness.
56325634
*/
@@ -5637,7 +5639,7 @@ pick_next_entity(struct rq *rq, struct cfs_rq *cfs_rq)
56375639
return cfs_rq->next;
56385640
}
56395641

5640-
struct sched_entity *se = pick_eevdf(cfs_rq);
5642+
se = pick_eevdf(cfs_rq);
56415643
if (se->sched_delayed) {
56425644
dequeue_entities(rq, se, DEQUEUE_SLEEP | DEQUEUE_DELAYED);
56435645
/*

0 commit comments

Comments
 (0)