public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] nohz: More Kconfig and Rcu improvements
@ 2013-04-15 21:10 Frederic Weisbecker
  2013-04-15 21:10 ` [PATCH 1/5] nohz: Fix old dynticks idle Kconfig backward compatibility Frederic Weisbecker
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Frederic Weisbecker @ 2013-04-15 21:10 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Frederic Weisbecker, Paul E. McKenney, Josh Triplett,
	Chris Metcalf, Christoph Lameter, Geoff Levand, Gilad Ben Yossef,
	Hakan Akkan, Kevin Hilman, Li Zhong, Paul Gortmaker,
	Peter Zijlstra, Steven Rostedt, Thomas Gleixner

Ingo,

Please pull the latest timers/nohz branch that can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
	timers/nohz

HEAD: 65d798f0f9339ae2c4ebe9480e3260b33382a584

This fixes some of the issues you've reported. There is still the
dependency on CONFIG_VIRT_CPU_ACCOUNTING_GEN to fix, probably in
the Kconfig side. Stay tuned.

Thanks.

---
Frederic Weisbecker (4):
  nohz: Fix old dynticks idle Kconfig backward compatibility
  nohz: Switch from "extended nohz" to "full nohz" based naming
  nohz: Align periodic tick Kconfig with other choices' naming
    convention
  nohz: Improve a bit the full dynticks Kconfig documentation

Paul E. McKenney (1):
  rcu: Kick adaptive-ticks CPUs that are holding up RCU grace periods

 Documentation/kernel-parameters.txt |    4 +-
 include/linux/tick.h                |    6 ++--
 kernel/rcutree.c                    |   10 ++++++
 kernel/rcutree.h                    |    1 +
 kernel/rcutree_plugin.h             |   18 +++++++++++
 kernel/sched/core.c                 |    6 ++--
 kernel/time/Kconfig                 |   26 ++++++++++------
 kernel/time/tick-broadcast.c        |    2 +-
 kernel/time/tick-common.c           |    2 +-
 kernel/time/tick-sched.c            |   54 +++++++++++++++++-----------------
 10 files changed, 82 insertions(+), 47 deletions(-)

-- 
1.7.5.4


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

* [PATCH 1/5] nohz: Fix old dynticks idle Kconfig backward compatibility
  2013-04-15 21:10 [GIT PULL] nohz: More Kconfig and Rcu improvements Frederic Weisbecker
@ 2013-04-15 21:10 ` Frederic Weisbecker
  2013-04-15 21:10 ` [PATCH 2/5] nohz: Switch from "extended nohz" to "full nohz" based naming Frederic Weisbecker
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Frederic Weisbecker @ 2013-04-15 21:10 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Frederic Weisbecker, Chris Metcalf, Christoph Lameter,
	Geoff Levand, Gilad Ben Yossef, Hakan Akkan, Kevin Hilman,
	Li Zhong, Paul E. McKenney, Paul Gortmaker, Peter Zijlstra,
	Steven Rostedt, Thomas Gleixner

In order to enforce backward compatibility with older
config files, we want the new dynticks-idle Kconfig entry
to default its value to the one of the old CONFIG_NO_HZ symbol
if present.

Namely we want:

	config NO_HZ # old obsolete dynticks idle symbol
		bool

	config NO_HZ_IDLE # new dynticks idle symbol
		default NO_HZ

However Kconfig prevents this to work if the old symbol
is not visible. And this is currently the case because
NO_HZ lacks a title in order to show it in make oldconfig
and alike.

To fix this, bring a minimal title and help text to the
obsolete Kconfig entry that explains its purpose. This
makes the "defaulting" to work.

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Gilad Ben Yossef <gilad@benyossef.com>
Cc: Hakan Akkan <hakanakkan@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/time/Kconfig |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index 27cc404..cbe64be 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -75,10 +75,6 @@ config NO_HZ_COMMON
 	depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
 	select TICK_ONESHOT
 
-# Kept around for compatibility, maps to NO_HZ_IDLE
-config NO_HZ
-	bool
-
 choice
 	prompt "Timer tick handling"
 	default NO_HZ_IDLE if NO_HZ
@@ -130,6 +126,14 @@ config NO_HZ_EXTENDED
 
 endchoice
 
+config NO_HZ
+	bool "Old Idle dynticks config"
+	depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
+	help
+	  This is the old config entry that enables dynticks idle.
+	  We keep it around for a little while to enforce backward
+	  compatibility with older config files.
+
 config HIGH_RES_TIMERS
 	bool "High Resolution Timer Support"
 	depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
-- 
1.7.5.4


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

* [PATCH 2/5] nohz: Switch from "extended nohz" to "full nohz" based naming
  2013-04-15 21:10 [GIT PULL] nohz: More Kconfig and Rcu improvements Frederic Weisbecker
  2013-04-15 21:10 ` [PATCH 1/5] nohz: Fix old dynticks idle Kconfig backward compatibility Frederic Weisbecker
@ 2013-04-15 21:10 ` Frederic Weisbecker
  2013-04-15 21:10 ` [PATCH 3/5] nohz: Align periodic tick Kconfig with other choices' naming convention Frederic Weisbecker
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Frederic Weisbecker @ 2013-04-15 21:10 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Frederic Weisbecker, Chris Metcalf, Christoph Lameter,
	Geoff Levand, Gilad Ben Yossef, Hakan Akkan, Kevin Hilman,
	Li Zhong, Paul E. McKenney, Paul Gortmaker, Peter Zijlstra,
	Steven Rostedt, Thomas Gleixner

"Extended nohz" was used as a naming base for the full dynticks
API and Kconfig symbols. It reflects the fact the system tries
to stop the tick in more places than just idle.

But that "extended" name is a bit opaque and vague. Rename it to
"full" makes it clearer what the system tries to do under this
config: try to shutdown the tick anytime it can. The various
constraints that prevent that to happen shouldn't be considered
as fundamental properties of this feature but rather technical
issues that may be solved in the future.

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Gilad Ben Yossef <gilad@benyossef.com>
Cc: Hakan Akkan <hakanakkan@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 Documentation/kernel-parameters.txt |    4 +-
 include/linux/tick.h                |    6 ++--
 kernel/sched/core.c                 |    6 ++--
 kernel/time/Kconfig                 |    4 +-
 kernel/time/tick-broadcast.c        |    2 +-
 kernel/time/tick-common.c           |    2 +-
 kernel/time/tick-sched.c            |   54 +++++++++++++++++-----------------
 7 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 231698f..82365dd 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1913,8 +1913,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			Valid arguments: on, off
 			Default: on
 
-	nohz_extended=  [KNL,BOOT]
-			In kernels built with CONFIG_NO_HZ_EXTENDED=y, set
+	nohz_full=	[KNL,BOOT]
+			In kernels built with CONFIG_NO_HZ_FULL=y, set
 			the specified list of CPUs whose tick will be stopped
 			whenever possible. You need to keep at least one online
 			CPU outside the range to maintain the timekeeping.
diff --git a/include/linux/tick.h b/include/linux/tick.h
index 5e40333..b4e3b0c 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -157,10 +157,10 @@ static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; }
 static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; }
 # endif /* !CONFIG_NO_HZ_COMMON */
 
-#ifdef CONFIG_NO_HZ_EXTENDED
-extern int tick_nohz_extended_cpu(int cpu);
+#ifdef CONFIG_NO_HZ_FULL
+extern int tick_nohz_full_cpu(int cpu);
 #else
-static inline int tick_nohz_extended_cpu(int cpu) { return 0; }
+static inline int tick_nohz_full_cpu(int cpu) { return 0; }
 #endif
 
 
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 9bb397d..0f0a5b3 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -617,9 +617,9 @@ static void wake_up_idle_cpu(int cpu)
 		smp_send_reschedule(cpu);
 }
 
-static bool wake_up_extended_nohz_cpu(int cpu)
+static bool wake_up_full_nohz_cpu(int cpu)
 {
-	if (tick_nohz_extended_cpu(cpu)) {
+	if (tick_nohz_full_cpu(cpu)) {
 		if (cpu != smp_processor_id() ||
 		    tick_nohz_tick_stopped())
 			smp_send_reschedule(cpu);
@@ -631,7 +631,7 @@ static bool wake_up_extended_nohz_cpu(int cpu)
 
 void wake_up_nohz_cpu(int cpu)
 {
-	if (!wake_up_extended_nohz_cpu(cpu))
+	if (!wake_up_full_nohz_cpu(cpu))
 		wake_up_idle_cpu(cpu);
 }
 
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index cbe64be..4a17b50 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -96,7 +96,7 @@ config NO_HZ_IDLE
 
 	  Most of the time you want to say Y here.
 
-config NO_HZ_EXTENDED
+config NO_HZ_FULL
 	bool "Full dynticks system (tickless single task)"
 	# NO_HZ_COMMON dependency
 	depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
@@ -115,7 +115,7 @@ config NO_HZ_EXTENDED
 	 task on the CPU. Chances for running tickless are maximized when
 	 the task mostly runs in userspace and has few kernel activity.
 
-	 You need to fill up the nohz_extended boot parameter with the
+	 You need to fill up the nohz_full boot parameter with the
 	 desired range of dynticks CPUs.
 
 	 This is implemented at the expense of some overhead in user <-> kernel
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 8a6875c..a3a3123 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -573,7 +573,7 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
 		bc->event_handler = tick_handle_oneshot_broadcast;
 
 		/* Take the do_timer update */
-		if (!tick_nohz_extended_cpu(cpu))
+		if (!tick_nohz_full_cpu(cpu))
 			tick_do_timer_cpu = cpu;
 
 		/*
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index b7dc0cb..83f2bd9 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -163,7 +163,7 @@ static void tick_setup_device(struct tick_device *td,
 		 * this cpu:
 		 */
 		if (tick_do_timer_cpu == TICK_DO_TIMER_BOOT) {
-			if (!tick_nohz_extended_cpu(cpu))
+			if (!tick_nohz_full_cpu(cpu))
 				tick_do_timer_cpu = cpu;
 			else
 				tick_do_timer_cpu = TICK_DO_TIMER_NONE;
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index e057d33..369b576 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -113,7 +113,7 @@ static void tick_sched_do_timer(ktime_t now)
 	 * jiffies_lock.
 	 */
 	if (unlikely(tick_do_timer_cpu == TICK_DO_TIMER_NONE)
-	    && !tick_nohz_extended_cpu(cpu))
+	    && !tick_nohz_full_cpu(cpu))
 		tick_do_timer_cpu = cpu;
 #endif
 
@@ -143,29 +143,29 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs)
 	profile_tick(CPU_PROFILING);
 }
 
-#ifdef CONFIG_NO_HZ_EXTENDED
-static cpumask_var_t nohz_extended_mask;
-bool have_nohz_extended_mask;
+#ifdef CONFIG_NO_HZ_FULL
+static cpumask_var_t nohz_full_mask;
+bool have_nohz_full_mask;
 
-int tick_nohz_extended_cpu(int cpu)
+int tick_nohz_full_cpu(int cpu)
 {
-	if (!have_nohz_extended_mask)
+	if (!have_nohz_full_mask)
 		return 0;
 
-	return cpumask_test_cpu(cpu, nohz_extended_mask);
+	return cpumask_test_cpu(cpu, nohz_full_mask);
 }
 
 /* Parse the boot-time nohz CPU list from the kernel parameters. */
-static int __init tick_nohz_extended_setup(char *str)
+static int __init tick_nohz_full_setup(char *str)
 {
-	alloc_bootmem_cpumask_var(&nohz_extended_mask);
-	if (cpulist_parse(str, nohz_extended_mask) < 0)
-		pr_warning("NOHZ: Incorrect nohz_extended cpumask\n");
+	alloc_bootmem_cpumask_var(&nohz_full_mask);
+	if (cpulist_parse(str, nohz_full_mask) < 0)
+		pr_warning("NOHZ: Incorrect nohz_full cpumask\n");
 	else
-		have_nohz_extended_mask = true;
+		have_nohz_full_mask = true;
 	return 1;
 }
-__setup("nohz_extended=", tick_nohz_extended_setup);
+__setup("nohz_full=", tick_nohz_full_setup);
 
 static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb,
 						 unsigned long action,
@@ -179,7 +179,7 @@ static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb,
 		 * If we handle the timekeeping duty for full dynticks CPUs,
 		 * we can't safely shutdown that CPU.
 		 */
-		if (have_nohz_extended_mask && tick_do_timer_cpu == cpu)
+		if (have_nohz_full_mask && tick_do_timer_cpu == cpu)
 			return -EINVAL;
 		break;
 	}
@@ -191,20 +191,20 @@ static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb,
  * separations: 0,2,4,6,...
  * This is NR_CPUS + sizeof('\0')
  */
-static char __initdata nohz_ext_buf[NR_CPUS + 1];
+static char __initdata nohz_full_buf[NR_CPUS + 1];
 
-static int __init init_tick_nohz_extended(void)
+static int __init init_tick_nohz_full(void)
 {
 	cpumask_var_t online_nohz;
 	int cpu;
 
-	if (!have_nohz_extended_mask)
+	if (!have_nohz_full_mask)
 		return 0;
 
 	cpu_notifier(tick_nohz_cpu_down_callback, 0);
 
 	if (!zalloc_cpumask_var(&online_nohz, GFP_KERNEL)) {
-		pr_warning("NO_HZ: Not enough memory to check extended nohz mask\n");
+		pr_warning("NO_HZ: Not enough memory to check full nohz mask\n");
 		return -ENOMEM;
 	}
 
@@ -215,31 +215,31 @@ static int __init init_tick_nohz_extended(void)
 	get_online_cpus();
 
 	/* Ensure we keep a CPU outside the dynticks range for timekeeping */
-	cpumask_and(online_nohz, cpu_online_mask, nohz_extended_mask);
+	cpumask_and(online_nohz, cpu_online_mask, nohz_full_mask);
 	if (cpumask_equal(online_nohz, cpu_online_mask)) {
 		pr_warning("NO_HZ: Must keep at least one online CPU "
-			   "out of nohz_extended range\n");
+			   "out of nohz_full range\n");
 		/*
 		 * We know the current CPU doesn't have its tick stopped.
 		 * Let's use it for the timekeeping duty.
 		 */
 		preempt_disable();
 		cpu = smp_processor_id();
-		pr_warning("NO_HZ: Clearing %d from nohz_extended range\n", cpu);
-		cpumask_clear_cpu(cpu, nohz_extended_mask);
+		pr_warning("NO_HZ: Clearing %d from nohz_full range\n", cpu);
+		cpumask_clear_cpu(cpu, nohz_full_mask);
 		preempt_enable();
 	}
 	put_online_cpus();
 	free_cpumask_var(online_nohz);
 
-	cpulist_scnprintf(nohz_ext_buf, sizeof(nohz_ext_buf), nohz_extended_mask);
-	pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_ext_buf);
+	cpulist_scnprintf(nohz_full_buf, sizeof(nohz_full_buf), nohz_full_mask);
+	pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_full_buf);
 
 	return 0;
 }
-core_initcall(init_tick_nohz_extended);
+core_initcall(init_tick_nohz_full);
 #else
-#define have_nohz_extended_mask (0)
+#define have_nohz_full_mask (0)
 #endif
 
 /*
@@ -589,7 +589,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
 		return false;
 	}
 
-	if (have_nohz_extended_mask) {
+	if (have_nohz_full_mask) {
 		/*
 		 * Keep the tick alive to guarantee timekeeping progression
 		 * if there are full dynticks CPUs around
-- 
1.7.5.4


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

* [PATCH 3/5] nohz: Align periodic tick Kconfig with other choices' naming convention
  2013-04-15 21:10 [GIT PULL] nohz: More Kconfig and Rcu improvements Frederic Weisbecker
  2013-04-15 21:10 ` [PATCH 1/5] nohz: Fix old dynticks idle Kconfig backward compatibility Frederic Weisbecker
  2013-04-15 21:10 ` [PATCH 2/5] nohz: Switch from "extended nohz" to "full nohz" based naming Frederic Weisbecker
@ 2013-04-15 21:10 ` Frederic Weisbecker
  2013-04-15 21:10 ` [PATCH 4/5] nohz: Improve a bit the full dynticks Kconfig documentation Frederic Weisbecker
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Frederic Weisbecker @ 2013-04-15 21:10 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Frederic Weisbecker, Chris Metcalf, Christoph Lameter,
	Geoff Levand, Gilad Ben Yossef, Hakan Akkan, Kevin Hilman,
	Li Zhong, Paul E. McKenney, Paul Gortmaker, Peter Zijlstra,
	Steven Rostedt, Thomas Gleixner

Rename CONFIG_PERIODIC_HZ to CONFIG_HZ_PERIODIC in
order to stay consistent with other tick implementation
entries:

	CONFIG_HZ_PERIODIC
	CONFIG_NO_HZ_IDLE
	CONFIG_NO_HZ_FULL

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Gilad Ben Yossef <gilad@benyossef.com>
Cc: Hakan Akkan <hakanakkan@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/time/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index 4a17b50..3b68322 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -79,7 +79,7 @@ choice
 	prompt "Timer tick handling"
 	default NO_HZ_IDLE if NO_HZ
 
-config PERIODIC_HZ
+config HZ_PERIODIC
 	bool "Periodic timer ticks (constant rate, no dynticks)"
 	help
 	  This option keeps the tick running periodically at a constant
-- 
1.7.5.4


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

* [PATCH 4/5] nohz: Improve a bit the full dynticks Kconfig documentation
  2013-04-15 21:10 [GIT PULL] nohz: More Kconfig and Rcu improvements Frederic Weisbecker
                   ` (2 preceding siblings ...)
  2013-04-15 21:10 ` [PATCH 3/5] nohz: Align periodic tick Kconfig with other choices' naming convention Frederic Weisbecker
@ 2013-04-15 21:10 ` Frederic Weisbecker
  2013-04-15 21:10 ` [PATCH 5/5] rcu: Kick adaptive-ticks CPUs that are holding up RCU grace periods Frederic Weisbecker
  2013-04-16  8:46 ` [GIT PULL] nohz: More Kconfig and Rcu improvements Ingo Molnar
  5 siblings, 0 replies; 7+ messages in thread
From: Frederic Weisbecker @ 2013-04-15 21:10 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Frederic Weisbecker, Chris Metcalf, Christoph Lameter,
	Geoff Levand, Gilad Ben Yossef, Hakan Akkan, Kevin Hilman,
	Li Zhong, Paul E. McKenney, Paul Gortmaker, Peter Zijlstra,
	Steven Rostedt, Thomas Gleixner

Remove the "single task" statement from CONFIG_NO_HZ_FULL
title. The constraint can be invalidated when tasks from
other sched classes than SCHED_FAIR are running. Moreover
it's possible that hrtick join the party in the future.

Also add a line about the dependency on SMP.

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Gilad Ben Yossef <gilad@benyossef.com>
Cc: Hakan Akkan <hakanakkan@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/time/Kconfig |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index 3b68322..358d601 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -97,11 +97,13 @@ config NO_HZ_IDLE
 	  Most of the time you want to say Y here.
 
 config NO_HZ_FULL
-	bool "Full dynticks system (tickless single task)"
+	bool "Full dynticks system (tickless)"
 	# NO_HZ_COMMON dependency
 	depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
-	# RCU_USER_QS
-	depends on HAVE_CONTEXT_TRACKING && SMP
+	# We need at least one periodic CPU for timekeeping
+	depends on SMP
+	# RCU_USER_QS dependency
+	depends on HAVE_CONTEXT_TRACKING
 	# RCU_NOCB_CPU dependency
 	depends on TREE_RCU || TREE_PREEMPT_RCU
 	depends on VIRT_CPU_ACCOUNTING_GEN
-- 
1.7.5.4


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

* [PATCH 5/5] rcu: Kick adaptive-ticks CPUs that are holding up RCU grace periods
  2013-04-15 21:10 [GIT PULL] nohz: More Kconfig and Rcu improvements Frederic Weisbecker
                   ` (3 preceding siblings ...)
  2013-04-15 21:10 ` [PATCH 4/5] nohz: Improve a bit the full dynticks Kconfig documentation Frederic Weisbecker
@ 2013-04-15 21:10 ` Frederic Weisbecker
  2013-04-16  8:46 ` [GIT PULL] nohz: More Kconfig and Rcu improvements Ingo Molnar
  5 siblings, 0 replies; 7+ messages in thread
From: Frederic Weisbecker @ 2013-04-15 21:10 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Paul E. McKenney, Frederic Weisbecker, Chris Metcalf,
	Christoph Lameter, Geoff Levand, Gilad Ben Yossef, Hakan Akkan,
	Kevin Hilman, Li Zhong, Paul Gortmaker, Peter Zijlstra,
	Steven Rostedt, Thomas Gleixner

From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>

Adaptive-ticks CPUs inform RCU when they enter kernel mode, but they do
not necessarily turn the scheduler-clock tick back on.  This state of
affairs could result in RCU waiting on an adaptive-ticks CPU running
for an extended period in kernel mode.  Such a CPU will never run the
RCU state machine, and could therefore indefinitely extend the RCU state
machine, sooner or later resulting in an OOM condition.

This patch, inspired by an earlier patch by Frederic Weisbecker, therefore
causes RCU's force-quiescent-state processing to check for this condition
and to send an IPI to CPUs that remain in that state for too long.
"Too long" currently means about three jiffies by default, which is
quite some time for a CPU to remain in the kernel without blocking.
The rcu_tree.jiffies_till_first_fqs and rcutree.jiffies_till_next_fqs
sysfs variables may be used to tune "too long" if needed.

Reported-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Gilad Ben Yossef <gilad@benyossef.com>
Cc: Hakan Akkan <hakanakkan@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/rcutree.c        |   10 ++++++++++
 kernel/rcutree.h        |    1 +
 kernel/rcutree_plugin.h |   18 ++++++++++++++++++
 3 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 5b8ad82..f5ab502 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -794,6 +794,16 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
 		rdp->offline_fqs++;
 		return 1;
 	}
+
+	/*
+	 * There is a possibility that a CPU in adaptive-ticks state
+	 * might run in the kernel with the scheduling-clock tick disabled
+	 * for an extended time period.  Invoke rcu_kick_nohz_cpu() to
+	 * force the CPU to restart the scheduling-clock tick in this
+	 * CPU is in this state.
+	 */
+	rcu_kick_nohz_cpu(rdp->cpu);
+
 	return 0;
 }
 
diff --git a/kernel/rcutree.h b/kernel/rcutree.h
index c896b50..f993c0a 100644
--- a/kernel/rcutree.h
+++ b/kernel/rcutree.h
@@ -539,6 +539,7 @@ static void rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp);
 static void rcu_spawn_nocb_kthreads(struct rcu_state *rsp);
 static void init_nocb_callback_list(struct rcu_data *rdp);
 static void __init rcu_init_nocb(void);
+static void rcu_kick_nohz_cpu(int cpu);
 
 #endif /* #ifndef RCU_TREE_NONCORE */
 
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index c1cc7e1..a5745e9 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -28,6 +28,7 @@
 #include <linux/gfp.h>
 #include <linux/oom.h>
 #include <linux/smpboot.h>
+#include <linux/tick.h>
 
 #define RCU_KTHREAD_PRIO 1
 
@@ -2502,3 +2503,20 @@ static void __init rcu_init_nocb(void)
 }
 
 #endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */
+
+/*
+ * An adaptive-ticks CPU can potentially execute in kernel mode for an
+ * arbitrarily long period of time with the scheduling-clock tick turned
+ * off.  RCU will be paying attention to this CPU because it is in the
+ * kernel, but the CPU cannot be guaranteed to be executing the RCU state
+ * machine because the scheduling-clock tick has been disabled.  Therefore,
+ * if an adaptive-ticks CPU is failing to respond to the current grace
+ * period and has not be idle from an RCU perspective, kick it.
+ */
+static void rcu_kick_nohz_cpu(int cpu)
+{
+#ifdef CONFIG_NO_HZ_FULL
+	if (tick_nohz_full_cpu(cpu))
+		smp_send_reschedule(cpu);
+#endif /* #ifdef CONFIG_NO_HZ_FULL */
+}
-- 
1.7.5.4


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

* Re: [GIT PULL] nohz: More Kconfig and Rcu improvements
  2013-04-15 21:10 [GIT PULL] nohz: More Kconfig and Rcu improvements Frederic Weisbecker
                   ` (4 preceding siblings ...)
  2013-04-15 21:10 ` [PATCH 5/5] rcu: Kick adaptive-ticks CPUs that are holding up RCU grace periods Frederic Weisbecker
@ 2013-04-16  8:46 ` Ingo Molnar
  5 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2013-04-16  8:46 UTC (permalink / raw)
  To: Frederic Weisbecker
  Cc: LKML, Paul E. McKenney, Josh Triplett, Chris Metcalf,
	Christoph Lameter, Geoff Levand, Gilad Ben Yossef, Hakan Akkan,
	Kevin Hilman, Li Zhong, Paul Gortmaker, Peter Zijlstra,
	Steven Rostedt, Thomas Gleixner


* Frederic Weisbecker <fweisbec@gmail.com> wrote:

> Ingo,
> 
> Please pull the latest timers/nohz branch that can be found at:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
> 	timers/nohz
> 
> HEAD: 65d798f0f9339ae2c4ebe9480e3260b33382a584
> 
> This fixes some of the issues you've reported. There is still the
> dependency on CONFIG_VIRT_CPU_ACCOUNTING_GEN to fix, probably in
> the Kconfig side. Stay tuned.
> 
> Thanks.
> 
> ---
> Frederic Weisbecker (4):
>   nohz: Fix old dynticks idle Kconfig backward compatibility
>   nohz: Switch from "extended nohz" to "full nohz" based naming
>   nohz: Align periodic tick Kconfig with other choices' naming
>     convention
>   nohz: Improve a bit the full dynticks Kconfig documentation
> 
> Paul E. McKenney (1):
>   rcu: Kick adaptive-ticks CPUs that are holding up RCU grace periods
> 
>  Documentation/kernel-parameters.txt |    4 +-
>  include/linux/tick.h                |    6 ++--
>  kernel/rcutree.c                    |   10 ++++++
>  kernel/rcutree.h                    |    1 +
>  kernel/rcutree_plugin.h             |   18 +++++++++++
>  kernel/sched/core.c                 |    6 ++--
>  kernel/time/Kconfig                 |   26 ++++++++++------
>  kernel/time/tick-broadcast.c        |    2 +-
>  kernel/time/tick-common.c           |    2 +-
>  kernel/time/tick-sched.c            |   54 +++++++++++++++++-----------------
>  10 files changed, 82 insertions(+), 47 deletions(-)

Pulled, thanks Frederic!

	Ingo

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

end of thread, other threads:[~2013-04-16  8:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-15 21:10 [GIT PULL] nohz: More Kconfig and Rcu improvements Frederic Weisbecker
2013-04-15 21:10 ` [PATCH 1/5] nohz: Fix old dynticks idle Kconfig backward compatibility Frederic Weisbecker
2013-04-15 21:10 ` [PATCH 2/5] nohz: Switch from "extended nohz" to "full nohz" based naming Frederic Weisbecker
2013-04-15 21:10 ` [PATCH 3/5] nohz: Align periodic tick Kconfig with other choices' naming convention Frederic Weisbecker
2013-04-15 21:10 ` [PATCH 4/5] nohz: Improve a bit the full dynticks Kconfig documentation Frederic Weisbecker
2013-04-15 21:10 ` [PATCH 5/5] rcu: Kick adaptive-ticks CPUs that are holding up RCU grace periods Frederic Weisbecker
2013-04-16  8:46 ` [GIT PULL] nohz: More Kconfig and Rcu improvements Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox