forked from rubenslte/android_kernel_samsung_msm8226
sched: Reset rq->next_interval before going idle
next_balance, the point in jiffy time scale when a cpu will next load balance, could have been calculated when the cpu was busy. A busy cpu will apply its sched domain's busy_factor (usually > 1) in computing next_balance for that sched domain, which causes the (busy) cpu to load balance less frequently in its sched domains. However when the same cpu is going idle, its next_balance needs to be reset without consideration of busy_factor. Failure to do so would not trigger nohz idle balancer on that cpu for unnecessarily long time (introducing additional scheduling latencies for tasks). Fix bug in scheduler which aims to reset next_balance before a cpu goes idle (as per existing comment) but is clearly not doing so. Change-Id: I7e027a51686528c4092d770c7d33c874d38f5df4 Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
This commit is contained in:
+1
-1
@@ -4626,7 +4626,7 @@ void idle_balance(int this_cpu, struct rq *this_rq)
|
||||
|
||||
raw_spin_lock(&this_rq->lock);
|
||||
|
||||
if (pulled_task || time_after(jiffies, this_rq->next_balance)) {
|
||||
if (!pulled_task || time_after(jiffies, this_rq->next_balance)) {
|
||||
/*
|
||||
* We are going idle. next_balance may be set based on
|
||||
* a busy processor. So reset next_balance.
|
||||
|
||||
Reference in New Issue
Block a user