From 6ba9b346e1e0eca65ec589d32de3a9fe32dc5de6 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 19 Feb 2007 18:11:56 +0000 Subject: [PATCH] NOHZ: Fix RCU handling When a CPU is needed for RCU the tick has to continue even when it was stopped before. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Signed-off-by: Linus Torvalds --- kernel/time/tick-sched.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kernel/time/tick-sched.c') diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 95e41f7f850b..9234e44fc94a 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -191,19 +191,19 @@ void tick_nohz_stop_sched_tick(void) next_jiffies = get_next_timer_interrupt(last_jiffies); delta_jiffies = next_jiffies - last_jiffies; + if (rcu_needs_cpu(cpu)) + delta_jiffies = 1; /* * Do not stop the tick, if we are only one off * or if the cpu is required for rcu */ - if (!ts->tick_stopped && (delta_jiffies == 1 || rcu_needs_cpu(cpu))) + if (!ts->tick_stopped && delta_jiffies == 1) goto out; /* Schedule the tick, if we are at least one jiffie off */ if ((long)delta_jiffies >= 1) { - if (rcu_needs_cpu(cpu)) - delta_jiffies = 1; - else + if (delta_jiffies > 1) cpu_set(cpu, nohz_cpu_mask); /* * nohz_stop_sched_tick can be called several times before -- cgit v1.2.3 From bc5393a6c9c0e70b4b43fb2fb63e3315e9a15c8f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 19 Feb 2007 18:12:05 +0000 Subject: [PATCH] NOHZ: Produce debug output instead of a BUG() The BUG_ON() in tick_nohz_stop_sched_tick() triggers on some boxen. Remove the BUG_ON and print information about the pending softirq to allow better debugging of the problem. Signed-off-by: Thomas Gleixner Signed-off-by: Linus Torvalds --- kernel/time/tick-sched.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'kernel/time/tick-sched.c') diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 9234e44fc94a..512a4a906467 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -165,7 +165,9 @@ void tick_nohz_stop_sched_tick(void) goto end; cpu = smp_processor_id(); - BUG_ON(local_softirq_pending()); + if (unlikely(local_softirq_pending())) + printk(KERN_ERR "NOHZ: local_softirq_pending %02x\n", + local_softirq_pending()); now = ktime_get(); /* -- cgit v1.2.3 From 9e203bcc1051cac2a8b15c3ee9db4c0d05794abe Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sat, 24 Feb 2007 22:10:13 -0800 Subject: [TIME] tick-sched: Add missing asm/irq_regs.h include. Acked-by: Thomas Gleixner Signed-off-by: David S. Miller --- kernel/time/tick-sched.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'kernel/time/tick-sched.c') diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 512a4a906467..51556b95f60f 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -21,6 +21,8 @@ #include #include +#include + #include "tick-internal.h" /* -- cgit v1.2.3