linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* dyntick-hpc and RCU
@ 2010-11-04 23:21 Paul E. McKenney
  2010-11-05  5:27 ` Frederic Weisbecker
  2010-11-05 21:00 ` [PATCH] a local-timer-free version of RCU Joe Korty
  0 siblings, 2 replies; 62+ messages in thread
From: Paul E. McKenney @ 2010-11-04 23:21 UTC (permalink / raw)
  To: fweisbec, mathieu.desnoyers, dhowells, loic.minier, dhaval.giani
  Cc: tglx, peterz, linux-kernel, josh

Hello!

Just wanted some written record of our discussion this Wednesday.
I don't have an email address for Jim Houston, and I am not sure I have
all of the attendees, but here goes anyway.  Please don't hesitate to
reply with any corrections!

The goal is to be able to turn of scheduling-clock interrupts for
long-running user-mode execution when there is but one runnable task
on a given CPU, but while still allowing RCU to function correctly.
In particular, we need to minimize (or better, eliminate) any source
of interruption to such a CPU.  We discussed these approaches, along
with their advantages and disadvantages:

1.	If a user task is executing in dyntick-hpc mode, inform RCU
	of all kernel/user transitions, calling rcu_enter_nohz()
	on each transition to user-mode execution and calling
	rcu_exit_nohz() on each transition to kernel-mode execution.

	+	Transitions due to interrupts and NMIs are already
		handled by the existing dyntick-idle code.

	+	RCU works without changes.

	-	-Every- exception path must be located and instrumented.

	-	Every system call must be instrumented.

	-	The system-call return fastpath is disabled by this
		approach, increasing the overhead of system calls.

	--	The scheduling-clock timer must be restarted on each
		transition to kernel-mode execution.  This is thought
		to be difficult on some of the exception code paths,
		and has high overhead regardless.

2.	Like #1 above, but instead of starting up the scheduling-clock
	timer on the CPU transitioning into the kernel, instead wake
	up a kthread that IPIs this CPU.  This has roughly the same
	advantages and disadvantages as #1 above, but substitutes
	a less-ugly kthread-wakeup operation in place of starting
	the scheduling-clock timer.

	There are a number of variations on this approach, but the
	rest of them are infeasible due to the fact that irq-disable
	and preempt-disable code sections are implicit read-side
	critical sections for RCU-sched.

3.	Substitute an RCU implementation similar to Jim Houston's
	real-time RCU implementation used by Concurrent.  (Jim posted
	this in 2004: http://lkml.org/lkml/2004/8/30/87 against
	2.6.1.1-mm4.)  In this implementation, the RCU grace periods
	are driven out of rcu_read_unlock(), so that there is no
	dependency on the scheduler-clock interrupt.

	+	Allows dyntick-hpc to simply require this alternative
		RCU implementation, without the need to interact
		with it.

	0	This implementation disables preemption across
		RCU read-side critical sections, which might be
		unacceptable for some users.  Or it might be OK,
		we were unable to determine this.

	0	This implementation increases the overhead of
		rcu_read_lock() and rcu_read_unlock().  However,
		this is probably acceptable, especially given that
		the workloads in question execute almost entirely
		in user space.

	---	Implicit RCU-sched and RCU-bh read-side critical
		sections would need to be explicitly marked with
		rcu_read_lock_sched() and rcu_read_lock_bh(),
		respectively.  Implicit critical sections include
		disabled preemption, disabled interrupts, hardirq
		handlers, and NMI handlers.  This change would
		require a large, intrusive, high-regression-risk patch.
		In addition, the hardirq-handler portion has been proposed
		and rejected in the past.

4.	Substitute an RCU implementation based on one of the
	user-level RCU implementations.  This has roughly the same
	advantages and disadvantages as does #3 above.

5.	Don't tell RCU about dyntick-hpc mode, but instead make RCU
	push processing through via some processor that is kept out
	of dyntick-hpc mode.  This requires that the rcutree RCU
	priority boosting be pushed further along so that RCU grace period
	and callback processing is done in kthread context, permitting
	remote forcing of grace periods.  The RCU_JIFFIES_TILL_FORCE_QS
	macro is promoted to a config variable, retaining its value
	of 3 in absence of dyntick-hpc, but getting value of HZ
	(or thereabouts) for dyntick-hpc builds.  In dyntick-hpc
	builds, force_quiescent_state() would push grace periods
	for CPUs lacking a scheduling-clock interrupt.

	+	Relatively small changes to RCU, some of which is
		coming with RCU priority boosting anyway.

	+	No need to inform RCU of user/kernel transitions.

	+	No need to turn scheduling-clock interrupts on
		at each user/kernel transition.

	-	Some IPIs to dyntick-hpc CPUs remain, but these
		are down in the every-second-or-so frequency,
		so hopefully are not a real problem.

6.	Your idea here!

The general consensus at the end of the meeting was that #5 was most
likely to work out the best.

							Thanx, Paul

PS.  If anyone knows Jim Houston's email address, please feel free
     to forward to him.

^ permalink raw reply	[flat|nested] 62+ messages in thread
[parent not found: <1103753684.861128.1289015433137.JavaMail.root@sz0076a.westchester.pa.mail.comcast.net>]

end of thread, other threads:[~2011-03-14  0:58 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-04 23:21 dyntick-hpc and RCU Paul E. McKenney
2010-11-05  5:27 ` Frederic Weisbecker
2010-11-05  5:38   ` Frederic Weisbecker
2010-11-05 15:06     ` Paul E. McKenney
2010-11-05 20:06       ` Dhaval Giani
2010-11-05 15:04   ` Paul E. McKenney
2010-11-08 14:10     ` Frederic Weisbecker
2010-11-05 21:00 ` [PATCH] a local-timer-free version of RCU Joe Korty
2010-11-06 19:28   ` Paul E. McKenney
2010-11-06 19:34     ` Mathieu Desnoyers
2010-11-06 19:42       ` Mathieu Desnoyers
2010-11-06 19:44         ` Paul E. McKenney
2010-11-08  2:11     ` Udo A. Steinberg
2010-11-08  2:19       ` Udo A. Steinberg
2010-11-08  2:54         ` Paul E. McKenney
2010-11-08 15:32           ` Frederic Weisbecker
2010-11-08 19:38             ` Paul E. McKenney
2010-11-08 20:40               ` Frederic Weisbecker
2010-11-10 18:08                 ` Paul E. McKenney
2010-11-08 15:06     ` Frederic Weisbecker
2010-11-08 15:18       ` Joe Korty
2010-11-08 19:50         ` Paul E. McKenney
2010-11-08 19:49       ` Paul E. McKenney
2010-11-08 20:51         ` Frederic Weisbecker
2010-11-06 20:03   ` Mathieu Desnoyers
2010-11-09  9:22   ` Lai Jiangshan
2010-11-10 15:54     ` Frederic Weisbecker
2010-11-10 17:31       ` Peter Zijlstra
2010-11-10 17:45         ` Frederic Weisbecker
2010-11-11  4:19         ` Paul E. McKenney
2010-11-13 22:30           ` Frederic Weisbecker
2010-11-16  1:28             ` Paul E. McKenney
2010-11-16 13:52               ` Frederic Weisbecker
2010-11-16 15:51                 ` Paul E. McKenney
2010-11-17  0:52                   ` Frederic Weisbecker
2010-11-17  1:25                     ` Paul E. McKenney
2011-03-07 20:31                     ` [PATCH] An RCU for SMP with a single CPU garbage collector Joe Korty
     [not found]                       ` <20110307210157.GG3104@linux.vnet.ibm.com>
2011-03-07 21:16                         ` Joe Korty
2011-03-07 21:33                           ` Joe Korty
2011-03-07 22:51                           ` Joe Korty
2011-03-08  9:07                             ` Paul E. McKenney
2011-03-08 15:57                               ` Joe Korty
2011-03-08 22:53                                 ` Joe Korty
2011-03-10  0:30                                   ` Paul E. McKenney
2011-03-10  0:28                                 ` Paul E. McKenney
2011-03-09 22:29                           ` Frederic Weisbecker
2011-03-09 22:15                       ` [PATCH 2/4] jrcu: tap rcu_read_unlock Joe Korty
2011-03-10  0:34                         ` Paul E. McKenney
2011-03-10 19:50                           ` JRCU Theory of Operation Joe Korty
2011-03-12 14:36                             ` Paul E. McKenney
2011-03-13  0:43                               ` Joe Korty
2011-03-13  5:56                                 ` Paul E. McKenney
2011-03-13 23:53                                   ` Joe Korty
2011-03-14  0:50                                     ` Paul E. McKenney
2011-03-14  0:55                                       ` Josh Triplett
2011-03-09 22:16                       ` [PATCH 3/4] jrcu: tap might_resched() Joe Korty
2011-03-09 22:17                       ` [PATCH 4/4] jrcu: add new stat to /sys/kernel/debug/rcu/rcudata Joe Korty
2011-03-09 22:19                       ` [PATCH 1/4] jrcu: remove preempt_enable() tap [resend] Joe Korty
2011-03-12 14:36                       ` [PATCH] An RCU for SMP with a single CPU garbage collector Paul E. McKenney
2011-03-13  1:25                         ` Joe Korty
2011-03-13  6:09                           ` Paul E. McKenney
     [not found] <1103753684.861128.1289015433137.JavaMail.root@sz0076a.westchester.pa.mail.comcast.net>
2010-11-06  4:01 ` dyntick-hpc and RCU houston.jim

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