public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Suresh Siddha <suresh.b.siddha@intel.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	a.p.zijlstra@chello.nl, suresh.b.siddha@intel.com,
	tglx@linutronix.de, mingo@elte.hu
Subject: [tip:sched/urgent] sched: Fix nohz balance kick
Date: Tue, 21 Sep 2010 14:13:01 GMT	[thread overview]
Message-ID: <tip-f6c3f1686e7ec1dd8725a9a3dcb857dfd0c7a5bf@git.kernel.org> (raw)
In-Reply-To: <1284400941.2684.19.camel@sbsiddha-MOBL3.sc.intel.com>

Commit-ID:  f6c3f1686e7ec1dd8725a9a3dcb857dfd0c7a5bf
Gitweb:     http://git.kernel.org/tip/f6c3f1686e7ec1dd8725a9a3dcb857dfd0c7a5bf
Author:     Suresh Siddha <suresh.b.siddha@intel.com>
AuthorDate: Mon, 13 Sep 2010 11:02:21 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 21 Sep 2010 13:50:50 +0200

sched: Fix nohz balance kick

There's a situation where the nohz balancer will try to wake itself:

cpu-x is idle which is also ilb_cpu
got a scheduler tick during idle
and the nohz_kick_needed() in trigger_load_balance() checks for
rq_x->nr_running which might not be zero (because of someone waking a
task on this rq etc) and this leads to the situation of the cpu-x
sending a kick to itself.

And this can cause a lockup.

Avoid this by not marking ourself eligible for kicking.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1284400941.2684.19.camel@sbsiddha-MOBL3.sc.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/sched_fair.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index a171138..db3f674 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -3630,7 +3630,7 @@ static inline int nohz_kick_needed(struct rq *rq, int cpu)
 	if (time_before(now, nohz.next_balance))
 		return 0;
 
-	if (!rq->nr_running)
+	if (rq->idle_at_tick)
 		return 0;
 
 	first_pick_cpu = atomic_read(&nohz.first_pick_cpu);

  parent reply	other threads:[~2010-09-21 14:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-09 13:50 [PATCH] generic-ipi: fix deadlock in __smp_call_function_single Heiko Carstens
2010-09-10 11:06 ` Peter Zijlstra
2010-09-10 11:23   ` Jens Axboe
2010-09-10 11:47     ` Heiko Carstens
2010-09-10 15:47       ` [tip:core/urgent] generic-ipi: Fix " tip-bot for Heiko Carstens
2010-09-11  0:28   ` [PATCH] generic-ipi: fix " Andrew Morton
2010-09-11  9:20     ` Peter Zijlstra
2010-09-11 16:42       ` Venkatesh Pallipadi
2010-09-13  8:08         ` Heiko Carstens
2010-09-13 18:02         ` Suresh Siddha
2010-09-14  8:03           ` Peter Zijlstra
2010-09-14 11:19             ` Heiko Carstens
2010-09-17 22:12               ` Suresh Siddha
2010-09-18 15:18                 ` Peter Zijlstra
2010-09-21 14:13           ` tip-bot for Suresh Siddha [this message]
2010-09-26  8:42     ` Ingo Molnar
2010-09-26 12:59       ` Heiko Carstens
2010-09-26 16:23         ` Ingo Molnar

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=tip-f6c3f1686e7ec1dd8725a9a3dcb857dfd0c7a5bf@git.kernel.org \
    --to=suresh.b.siddha@intel.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.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