Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 184af1cd authored by Srivatsa Vaddagiri's avatar Srivatsa Vaddagiri Committed by Matt Wagantall
Browse files

sched: Initialize env->loop variable to 0



load_balance() function does not explicitly initialize env->loop
variable to 0. As a result, there is a vague possibility of
move_tasks() hitting a very long (unnecessary) loop when its unable to
move tasks from src_cpu. This can lead to unpleasant results like a
watchdog bark. Fix this by explicitly initializing env->loop variable
to 0 (in both load_balance() and active_load_balance_cpu_stop()).

Change-Id: I36b84c91a9753870fa16ef9c9339db7b706527be
Signed-off-by: default avatarSrivatsa Vaddagiri <vatsa@codeaurora.org>
parent 1c3183ee
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7936,6 +7936,7 @@ static int load_balance(int this_cpu, struct rq *this_rq,
		.tasks		= LIST_HEAD_INIT(env.tasks),
		.imbalance	= 0,
		.flags		= 0,
		.loop		= 0,
	};

	/*
@@ -8388,6 +8389,7 @@ static int active_load_balance_cpu_stop(void *data)
		.src_rq		= busiest_rq,
		.idle		= CPU_IDLE,
		.flags		= 0,
		.loop		= 0,
	};

	raw_spin_lock_irq(&busiest_rq->lock);