mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	Suresh B <suresh.b.siddha@intel.com>
Cc: linux-kernel@vger.kernel.org,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [PATCH v2] NOHZ: fix nohz on cpu unplug
Date: Mon, 2 Feb 2009 13:23:43 +0100	[thread overview]
Message-ID: <200902021323.44015.borntraeger@de.ibm.com> (raw)
In-Reply-To: <200902021058.45230.borntraeger@de.ibm.com>

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);

  reply	other threads:[~2009-02-02 12:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-30 16:29 [RFC] " Christian Borntraeger
2009-02-02  9:58 ` [PATCH/RFC] " Christian Borntraeger
2009-02-02 12:23   ` Christian Borntraeger [this message]
2009-02-02 23:57     ` [PATCH v2] " Suresh Siddha
2009-02-03  8:48       ` Christian Borntraeger
2009-02-03 12:28         ` Ingo Molnar
2009-02-04  6:19           ` Christian Borntraeger
2009-02-04 19:59             ` Suresh Siddha
2009-02-04 21:32               ` Ingo Molnar
2009-02-05 19:54                 ` Mark Lord
2009-02-06  2:33                   ` Suresh Siddha
2009-02-06 14:52                     ` Mark Lord

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200902021323.44015.borntraeger@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=schwidefsky@de.ibm.com \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome