linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rcu: Only pin GP kthread when full dynticks is actually used
@ 2014-06-13  0:16 Frederic Weisbecker
  2014-06-13  1:24 ` Paul E. McKenney
  0 siblings, 1 reply; 33+ messages in thread
From: Frederic Weisbecker @ 2014-06-13  0:16 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: LKML, Frederic Weisbecker, Josh Triplett, Steven Rostedt,
	Mathieu Desnoyers

CONFIG_NO_HZ_FULL may be enabled widely on distros nowadays but actual
users should be a tiny minority, if actually any.

Also there is a risk that affining the GP kthread to a single CPU could
end up noticeably reducing RCU performances and increasing energy
consumption.

So lets affine the GP kthread only when nohz full is actually used
(ie: when the nohz_full= parameter is filled or CONFIG_NO_HZ_FULL_ALL=y)

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
 kernel/rcu/tree_plugin.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index cbc2c45..726f52c 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -2843,12 +2843,16 @@ static bool rcu_nohz_full_cpu(struct rcu_state *rsp)
  */
 static void rcu_bind_gp_kthread(void)
 {
-#ifdef CONFIG_NO_HZ_FULL
-	int cpu = ACCESS_ONCE(tick_do_timer_cpu);
+	int cpu;
+
+	if (!tick_nohz_full_enabled())
+		return;
+
+	cpu = ACCESS_ONCE(tick_do_timer_cpu);
 
 	if (cpu < 0 || cpu >= nr_cpu_ids)
 		return;
+
 	if (raw_smp_processor_id() != cpu)
 		set_cpus_allowed_ptr(current, cpumask_of(cpu));
-#endif /* #ifdef CONFIG_NO_HZ_FULL */
 }
-- 
1.8.3.1


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

end of thread, other threads:[~2014-06-14 14:29 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-13  0:16 [PATCH] rcu: Only pin GP kthread when full dynticks is actually used Frederic Weisbecker
2014-06-13  1:24 ` Paul E. McKenney
2014-06-13  1:35   ` Paul E. McKenney
2014-06-13 12:47     ` Frederic Weisbecker
2014-06-13 15:52       ` Paul E. McKenney
2014-06-13 16:00         ` Frederic Weisbecker
2014-06-13 16:16           ` Paul E. McKenney
2014-06-13 16:21             ` Frederic Weisbecker
2014-06-13 16:44               ` Josh Triplett
2014-06-13 20:48                 ` Paul E. McKenney
2014-06-13 21:10                   ` Josh Triplett
2014-06-13 22:49                     ` Paul E. McKenney
2014-06-13 23:10                       ` Frederic Weisbecker
2014-06-13 23:27                         ` Paul E. McKenney
2014-06-13 23:39                           ` Frederic Weisbecker
2014-06-14  5:06                             ` Paul E. McKenney
2014-06-14 11:26                               ` Paul E. McKenney
2014-06-14 13:10                                 ` Frederic Weisbecker
2014-06-14 14:29                                   ` Paul E. McKenney
2014-06-14 13:05                               ` Frederic Weisbecker
2014-06-13 20:49               ` Paul E. McKenney
2014-06-13 23:13                 ` Frederic Weisbecker
2014-06-13 23:22                   ` Paul E. McKenney
2014-06-13  2:05   ` Paul E. McKenney
2014-06-13 12:55     ` Frederic Weisbecker
2014-06-13 15:55       ` Paul E. McKenney
2014-06-13 16:03         ` Frederic Weisbecker
2014-06-13 16:20           ` Paul E. McKenney
2014-06-13 16:10         ` Paul E. McKenney
2014-06-13 12:42   ` Frederic Weisbecker
2014-06-13 15:58     ` Paul E. McKenney
2014-06-13 16:09       ` Frederic Weisbecker
2014-06-13 16:23         ` Paul E. McKenney

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).