lkml.org 
[lkml]   [2009]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] NOHZ: fix nohz on cpu unplug
Date
After some testing, I think this patch is better:
[PATCH] NOHZ: fix nohz on cpu unplug

From: Christian Borntraeger <borntraeger@de.ibm.com>

After using cpu unplug I have seen one cpu with full ticks, even
on a idle systems. It turns out that nohz.cpu_mask is not updated on
cpu unplug.
In select_nohz_load_balancer we check if the system is completely
idle to turn of load balancing. We compare cpu_online_map with
nohz.cpu_mask.
Since cpu_online_map is updated on cpu unplug, but nohz.cpu_mask is
not, the check fails and the scheduler believes that we need an
"idle load balancer" even on a fully idle system. Since the ilb
cpu does not deactivate the timer tick this breaks NOHZ.

This patch clear the nohz bits in the migration_call, a function that
is already called by the cpu hotplug notifier.

Opinions?

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
kernel/sched.c | 1 +
1 file changed, 1 insertion(+)

Index: kvm/kernel/sched.c
===================================================================
--- kvm.orig/kernel/sched.c
+++ kvm/kernel/sched.c
@@ -6696,6 +6696,7 @@ migration_call(struct notifier_block *nf
rq->idle->sched_class = &idle_sched_class;
migrate_dead_tasks(cpu);
spin_unlock_irq(&rq->lock);
+ cpumask_clear_cpu(cpu, nohz.cpu_mask);
cpuset_unlock();
migrate_nr_uninterruptible(rq);
BUG_ON(rq->nr_running != 0);

\
 
 \ /
  Last update: 2009-02-02 13:27    [W:0.141 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site