diff mbox

[RFC,11/11] sched: nohz_idle_balance

Message ID 1319216261-2781-1-git-send-email-vincent.guittot@linaro.org
State New
Headers show

Commit Message

Vincent Guittot Oct. 21, 2011, 4:57 p.m. UTC
clear rq->nohz_balance_kick before returning

if idle equals CPU_IDLE, we return and could let nohz_balance_kick set
rq->nohz_balance_kick is tested in nohz_balancer_kick before triggering a SOFTIRQ on the ilb.
If this_rq->nohz_balance_kick stay to 1, the ilb will no be triggered until it wakes up and performs a normal load_balance which will clear the nohz_balance_kick

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
 kernel/sched_fair.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 3961876..044ffcc 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -3985,8 +3985,10 @@  static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle)
 	struct rq *rq;
 	int balance_cpu;
 
-	if (idle != CPU_IDLE || !this_rq->nohz_balance_kick)
+	if (idle != CPU_IDLE || !this_rq->nohz_balance_kick) {
+		this_rq->nohz_balance_kick = 0;
 		return;
+	}
 
 	for_each_cpu(balance_cpu, nohz.idle_cpus_mask) {
 		if (balance_cpu == this_cpu)