[tip:timers/urgent] nohz: Fix nohz ratelimit

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: tip-bot for Peter Zijlstra
Date: Thursday, June 17, 2010 - 10:39 am

Commit-ID:  3310d4d38fbc514e7b18bd3b1eea8effdd63b5aa
Gitweb:     http://git.kernel.org/tip/3310d4d38fbc514e7b18bd3b1eea8effdd63b5aa
Author:     Peter Zijlstra <peterz@infradead.org>
AuthorDate: Thu, 17 Jun 2010 18:02:37 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 17 Jun 2010 19:37:29 +0200

nohz: Fix nohz ratelimit

Chris Wedgwood reports that 39c0cbe (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: Chris Wedgwood <cw@f00f.org>
Tested-by: Brian Bloniarz <bmb@athenacr.com>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Peter 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: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/time/tick-sched.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 1d7b9bc..783fbad 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -315,9 +315,6 @@ void tick_nohz_stop_sched_tick(int inidle)
 		goto end;
 	}
 
-	if (nohz_ratelimit(cpu))
-		goto end;
-
 	ts->idle_calls++;
 	/* Read jiffies and the time when jiffies were updated last */
 	do {
@@ -328,7 +325,7 @@ void tick_nohz_stop_sched_tick(int inidle)
 	} while (read_seqretry(&xtime_lock, seq));
 
 	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;
 		delta_jiffies = 1;
 	} else {
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Slow pty's (was Re: libdivecomputer interfaces?), Linus Torvalds, (Thu Jun 10, 10:25 am)
Re: Slow pty's (was Re: libdivecomputer interfaces?), OGAWA Hirofumi, (Thu Jun 10, 11:07 am)
Re: Slow pty's (was Re: libdivecomputer interfaces?), Chris Wedgwood, (Thu Jun 10, 11:10 am)
Re: Slow pty's (was Re: libdivecomputer interfaces?), Brian Bloniarz, (Thu Jun 10, 3:25 pm)
Re: Slow pty's (was Re: libdivecomputer interfaces?), Linus Torvalds, (Thu Jun 10, 3:30 pm)
Re: Slow pty's (was Re: libdivecomputer interfaces?), Jiri Kosina, (Wed Jun 16, 8:03 am)
Re: Slow pty's (was Re: libdivecomputer interfaces?), Mike Galbraith, (Wed Jun 16, 8:16 am)
Re: Slow pty's (was Re: libdivecomputer interfaces?), Mike Galbraith, (Wed Jun 16, 11:39 pm)
Re: Slow pty's (was Re: libdivecomputer interfaces?), Mike Galbraith, (Thu Jun 17, 12:00 am)
Re: Slow pty's (was Re: libdivecomputer interfaces?), Mike Galbraith, (Thu Jun 17, 3:50 am)
Re: Slow pty's (was Re: libdivecomputer interfaces?), Peter Zijlstra, (Thu Jun 17, 6:24 am)
Re: Slow pty's (was Re: libdivecomputer interfaces?), Thomas Gleixner, (Thu Jun 17, 7:11 am)
Re: Slow pty's (was Re: libdivecomputer interfaces?), Mike Galbraith, (Thu Jun 17, 7:14 am)
Re: Slow pty's (was Re: libdivecomputer interfaces?), Brian Bloniarz, (Thu Jun 17, 7:56 am)
[PATCH] nohz: Fix nohz ratelimit, Peter Zijlstra, (Thu Jun 17, 9:02 am)
[tip:timers/urgent] nohz: Fix nohz ratelimit, tip-bot for Peter Zi ..., (Thu Jun 17, 10:39 am)
Re: Slow pty's (was Re: libdivecomputer interfaces?), Jef Driesen, (Fri Nov 12, 11:45 am)