linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* CONFIG_NO_HZ_FULL + CONFIG_PREEMPT_RT_FULL = nogo
@ 2013-10-31 14:07 Mike Galbraith
  2013-11-06 17:49 ` Thomas Gleixner
  0 siblings, 1 reply; 39+ messages in thread
From: Mike Galbraith @ 2013-10-31 14:07 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: Peter Zijlstra, LKML, RT

Hi Frederic,

The tick wakes ksoftirqd, ensuring nr_running test ain't gonna happen
when an otherwise lonely task takes the timer interrupt.  Deferring to
softirq processing time..... works.

---
 kernel/sched/core.c      |    2 +-
 kernel/softirq.c         |   10 ++++++++++
 kernel/time/tick-sched.c |    2 ++
 3 files changed, 13 insertions(+), 1 deletion(-)

--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -704,7 +704,7 @@ bool sched_can_stop_tick(void)
        smp_rmb();
 
        /* More than one running task need preemption */
-       if (rq->nr_running > 1)
+       if (rq->nr_running - (rq->curr == this_cpu_ksoftirqd()) > 1)
                return false;
 
        return true;
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -529,6 +529,11 @@ static void do_current_softirqs(int need
 		softirq_clr_runner(i);
 		unlock_softirq(i);
 		WARN_ON(current->softirq_nestcnt != 1);
+
+#ifdef CONFIG_NO_HZ_COMMON
+		if (i == TIMER_SOFTIRQ && tick_nohz_full_cpu(raw_smp_processor_id()))
+			 tick_nohz_irq_exit();
+#endif
 	}
 }
 
@@ -728,6 +733,11 @@ static inline void tick_irq_exit(void)
 #ifdef CONFIG_NO_HZ_COMMON
 	int cpu = smp_processor_id();
 
+#ifdef CONFIG_PREEMPT_RT_FULL
+	if (tick_nohz_full_cpu(cpu))
+		return;
+#endif
+
 	/* Make sure that timer wheel updates are propagated */
 	if ((idle_cpu(cpu) && !need_resched()) || tick_nohz_full_cpu(cpu)) {
 		if (!in_interrupt())
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -157,7 +157,9 @@ bool have_nohz_full_mask;
 
 static bool can_stop_full_tick(void)
 {
+#ifndef CONFIG_PREEMPT_RT_FULL
 	WARN_ON_ONCE(!irqs_disabled());
+#endif
 
 	if (!sched_can_stop_tick()) {
 		trace_tick_stop(0, "more than 1 task in runqueue\n");



^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2013-12-22  5:37 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-31 14:07 CONFIG_NO_HZ_FULL + CONFIG_PREEMPT_RT_FULL = nogo Mike Galbraith
2013-11-06 17:49 ` Thomas Gleixner
2013-11-07  3:26   ` Mike Galbraith
2013-11-07  4:31     ` Mike Galbraith
2013-11-07 11:21       ` Thomas Gleixner
2013-11-07 12:59         ` Frederic Weisbecker
2013-11-07 13:13           ` Thomas Gleixner
2013-11-12  8:06             ` Mike Galbraith
2013-11-12  9:28               ` Thomas Gleixner
2013-11-15 16:30                 ` [PATCH] rtmutex: take the waiter lock with irqs off Sebastian Andrzej Siewior
2013-11-15 20:14                   ` [PATCH v2] " Sebastian Andrzej Siewior
2013-11-18 14:10                     ` Peter Zijlstra
2013-11-18 17:56                       ` Peter Zijlstra
2013-11-18 23:59                       ` Frederic Weisbecker
2013-11-19  8:30                         ` Peter Zijlstra
2013-11-22 13:59                       ` Sebastian Andrzej Siewior
2013-11-22 16:08                         ` Peter Zijlstra
2013-11-22 16:21                           ` Sebastian Andrzej Siewior
2013-11-22 17:44                             ` Sebastian Andrzej Siewior
2013-11-25 18:33                           ` Paul Gortmaker
2013-11-07 13:07         ` CONFIG_NO_HZ_FULL + CONFIG_PREEMPT_RT_FULL = nogo Mike Galbraith
2013-12-20 15:41         ` Sebastian Andrzej Siewior
2013-12-21  9:11           ` Mike Galbraith
2013-12-21 17:21             ` Muli Baron
2013-12-22  4:17               ` Mike Galbraith
2013-12-22  5:10                 ` Mike Galbraith
2013-12-22  5:37                   ` Mike Galbraith
2013-12-22  5:16                 ` Mike Galbraith
2013-11-08  3:23       ` Paul E. McKenney
2013-11-08  7:31         ` Mike Galbraith
2013-11-08 12:37           ` Paul E. McKenney
2013-11-08 13:26             ` Mike Galbraith
2013-11-08 14:03               ` Paul E. McKenney
2013-11-08 14:21                 ` Mike Galbraith
2013-11-08 14:29                 ` Frederic Weisbecker
2013-11-08 14:45                   ` Paul E. McKenney
2013-11-08 16:03                     ` Frederic Weisbecker
2013-11-08 14:53                   ` Mike Galbraith
2013-11-08 16:04                     ` Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).