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

Commit b5d52215 authored by Satya Durga Srinivasu Prabhala's avatar Satya Durga Srinivasu Prabhala
Browse files

sched/fair: update_rq_clock after nr_running check in load balance path



As there is a possibility that number of running tasks could be
less than or equal to one and the check for nr_running leads to
not to move of the tasks, updating update_rq_clock before check
is wrong, fix it by moving update_rq_clock after the check.

Change-Id: I1719a5482af3c35131e18e9fd521cb9e5d2de2ae
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 81ab0bca
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -10160,7 +10160,6 @@ static int load_balance(int this_cpu, struct rq *this_rq,

more_balance:
		rq_lock_irqsave(busiest, &rf);
		update_rq_clock(busiest);

		/* The world might have changed. Validate assumptions */
		if (busiest->nr_running <= 1) {
@@ -10168,6 +10167,9 @@ static int load_balance(int this_cpu, struct rq *this_rq,
			env.flags &= ~LBF_ALL_PINNED;
			goto no_move;
		}

		update_rq_clock(busiest);

		/*
		 * cur_ld_moved - load moved in current iteration
		 * ld_moved     - cumulative load moved across iterations