Commit 3310d4d3 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Thomas Gleixner

nohz: Fix nohz ratelimit

Chris Wedgwood reports that 39c0cbe2 (sched: Rate-limit nohz) causes a
serial console regression, unresponsiveness, and indeed it does. The
reason is that the nohz code is skipped even when the tick was already
stopped before the nohz_ratelimit(cpu) condition changed.

Move the nohz_ratelimit() check to the other conditions which prevent
long idle sleeps.
Reported-by: default avatarChris Wedgwood <cw@f00f.org>
Tested-by: default avatarBrian Bloniarz <bmb@athenacr.com>
Signed-off-by: default avatarMike Galbraith <efault@gmx.de>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Greg KH <gregkh@suse.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Jef Driesen <jefdriesen@telenet.be>
LKML-Reference: <1276790557.27822.516.camel@twins>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 7e27d6e7
...@@ -315,9 +315,6 @@ void tick_nohz_stop_sched_tick(int inidle) ...@@ -315,9 +315,6 @@ void tick_nohz_stop_sched_tick(int inidle)
goto end; goto end;
} }
if (nohz_ratelimit(cpu))
goto end;
ts->idle_calls++; ts->idle_calls++;
/* Read jiffies and the time when jiffies were updated last */ /* Read jiffies and the time when jiffies were updated last */
do { do {
...@@ -328,7 +325,7 @@ void tick_nohz_stop_sched_tick(int inidle) ...@@ -328,7 +325,7 @@ void tick_nohz_stop_sched_tick(int inidle)
} while (read_seqretry(&xtime_lock, seq)); } while (read_seqretry(&xtime_lock, seq));
if (rcu_needs_cpu(cpu) || printk_needs_cpu(cpu) || if (rcu_needs_cpu(cpu) || printk_needs_cpu(cpu) ||
arch_needs_cpu(cpu)) { arch_needs_cpu(cpu) || nohz_ratelimit(cpu)) {
next_jiffies = last_jiffies + 1; next_jiffies = last_jiffies + 1;
delta_jiffies = 1; delta_jiffies = 1;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment