All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/6] rcu: Userspace RCU extended quiescent state
@ 2012-07-06 12:00 Frederic Weisbecker
  2012-07-06 12:00 ` [PATCH 1/6] rcu: Settle config for userspace " Frederic Weisbecker
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Frederic Weisbecker @ 2012-07-06 12:00 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: LKML, Frederic Weisbecker, Alessio Igor Bogani, Andrew Morton,
	Avi Kivity, Chris Metcalf, Christoph Lameter, Geoff Levand,
	Gilad Ben Yossef, Hakan Akkan, Ingo Molnar, Josh Triplett,
	Kevin Hilman, Max Krasnyansky, Peter Zijlstra, Stephen Hemminger,
	Steven Rostedt, Sven-Thorsten Dietrich, Thomas Gleixner,
	H. Peter Anvin

Hi,

Although this feature is useless alone, it is necessary to prepare
our kernel to be more tickless. With this, RCU doesn't need the tick
anymore on a CPU running in userspace.

I've made it a standalone feature because maintaining it on a big
tree like nohz cpusets doesn't scale. I'm trying to integrate the
components piecewise now as much as possible.

Once we have everything in place, this should be merged into
a CONFIG_NO_HZ_FULL option.

So what do you think? The version I use in my nohz cpusets is
doing a bit differently: instead of hooking in entry.S, it hooks
in higher level exception handlers (do_debug(), do_page_fault(), etc...)
and syscall slow path.

This version rather hooks in low level entry code. I'm not sure which is
the best. Both have their pros and cons. This is mostly about details.

I can cook a patchset with hooks on the higher level handlers to show
you if you want.

I also don't know yet if I should keep the previous TIF_NOHZ and use
syscalls slow path or not.

Yeah I'm still a bit brainstorming...

git://github.com/fweisbec/linux-dynticks.git
	rcu/user

Frederic Weisbecker (6):
  rcu: Settle config for userspace extended quiescent state
  rcu: Allow rcu_user_enter()/exit() to nest
  rcu: Exit RCU extended QS on preemption in irq exit
  x86: Use the new schedule_user API on user preemption
  x86: Kernel entry/exit hooks for RCU
  x86: Exit RCU extended QS on notify resume

 arch/Kconfig               |   13 +++++++++++++
 arch/x86/Kconfig           |    1 +
 arch/x86/include/asm/rcu.h |    7 +++++++
 arch/x86/kernel/entry_64.S |   33 +++++++++++++++++++++++++++++----
 arch/x86/kernel/signal.c   |    2 ++
 init/Kconfig               |   10 ++++++++++
 kernel/rcutree.c           |   42 ++++++++++++++++++++++++++++++++++--------
 kernel/sched/core.c        |    7 +++++++
 8 files changed, 103 insertions(+), 12 deletions(-)
 create mode 100644 arch/x86/include/asm/rcu.h

-- 
1.7.5.4


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

* [PATCH 1/6] rcu: Settle config for userspace extended quiescent state
  2012-07-06 12:00 [RFC PATCH 0/6] rcu: Userspace RCU extended quiescent state Frederic Weisbecker
@ 2012-07-06 12:00 ` Frederic Weisbecker
  2012-07-06 16:31   ` Paul E. McKenney
  2012-07-06 12:00 ` [PATCH 2/6] rcu: Allow rcu_user_enter()/exit() to nest Frederic Weisbecker
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 18+ messages in thread
From: Frederic Weisbecker @ 2012-07-06 12:00 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: LKML, Frederic Weisbecker, Alessio Igor Bogani, Andrew Morton,
	Avi Kivity, Chris Metcalf, Christoph Lameter, Geoff Levand,
	Gilad Ben Yossef, Hakan Akkan, H. Peter Anvin, Ingo Molnar,
	Josh Triplett, Kevin Hilman, Max Krasnyansky, Peter Zijlstra,
	Stephen Hemminger, Steven Rostedt, Sven-Thorsten Dietrich,
	Thomas Gleixner

Create a new config option under the RCU menu that put
CPUs under RCU extended quiescent state (as in dynticks
idle mode) when they run in userspace. This require
some contribution from architectures to hook into kernel
and userspace boundaries.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Alessio Igor Bogani <abogani@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Avi Kivity <avi@redhat.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: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Max Krasnyansky <maxk@qualcomm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 arch/Kconfig     |   13 +++++++++++++
 init/Kconfig     |   10 ++++++++++
 kernel/rcutree.c |    4 ++++
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index 8c3d957..c2e0ce4 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -274,4 +274,17 @@ config SECCOMP_FILTER
 
 	  See Documentation/prctl/seccomp_filter.txt for details.
 
+config HAVE_RCU_USER_QS
+	bool
+	help
+	  Provide kernel entry/exit hooks necessary for userspace
+	  RCU extended quiescent state. Syscalls and exceptions
+	  low level handlers must be wrapped with a call to rcu_user_exit()
+	  on entry and rcu_user_enter() before resuming userspace. Irqs
+	  entry don't need to call rcu_user_exit() because their high level
+	  handlers are protected inside rcu_irq_enter/rcu_irq_exit() but
+	  preemption or signal handling on irq exit still need to be protected
+	  with a call to rcu_user_exit(). rcu_user_enter() must then be
+	  called back on irq exit when the preempted task is back on the CPU.
+
 source "kernel/gcov/Kconfig"
diff --git a/init/Kconfig b/init/Kconfig
index d07dcf9..3a4af8f 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -441,6 +441,16 @@ config PREEMPT_RCU
 	  This option enables preemptible-RCU code that is common between
 	  the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations.
 
+config RCU_USER_QS
+	bool "Consider userspace as in RCU extended quiescent state"
+	depends on HAVE_RCU_USER_QS && SMP
+	help
+	  This option sets hooks on kernel / userspace boundaries and
+	  puts RCU in extended quiescent state when the CPU runs in
+	  userspace. It means that when a CPU runs in userspace, it is
+	  excluded from the global RCU state machine and thus doesn't
+	  need to keep the timer tick on for RCU.
+
 config RCU_FANOUT
 	int "Tree-based hierarchical RCU fanout value"
 	range 2 64 if 64BIT
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 5541a07..64fc2cd 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -423,6 +423,7 @@ void rcu_idle_enter(void)
 }
 EXPORT_SYMBOL_GPL(rcu_idle_enter);
 
+#ifdef CONFIG_RCU_USER_QS
 /**
  * rcu_user_enter - inform RCU that we are resuming userspace.
  *
@@ -436,6 +437,7 @@ void rcu_user_enter(void)
 	rcu_eqs_enter(1);
 }
 EXPORT_SYMBOL_GPL(rcu_user_enter);
+#endif
 
 
 /**
@@ -561,6 +563,7 @@ void rcu_idle_exit(void)
 }
 EXPORT_SYMBOL_GPL(rcu_idle_exit);
 
+#ifdef CONFIG_RCU_USER_QS
 /**
  * rcu_user_exit - inform RCU that we are exiting userspace.
  *
@@ -572,6 +575,7 @@ void rcu_user_exit(void)
 	rcu_eqs_exit(1);
 }
 EXPORT_SYMBOL_GPL(rcu_user_exit);
+#endif
 
 /**
  * rcu_user_exit_irq - inform RCU that we won't resume to userspace
-- 
1.7.5.4


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

* [PATCH 2/6] rcu: Allow rcu_user_enter()/exit() to nest
  2012-07-06 12:00 [RFC PATCH 0/6] rcu: Userspace RCU extended quiescent state Frederic Weisbecker
  2012-07-06 12:00 ` [PATCH 1/6] rcu: Settle config for userspace " Frederic Weisbecker
@ 2012-07-06 12:00 ` Frederic Weisbecker
  2012-07-06 16:27   ` Paul E. McKenney
  2012-07-08 15:54   ` Avi Kivity
  2012-07-06 12:00 ` [PATCH 3/6] rcu: Exit RCU extended QS on preemption in irq exit Frederic Weisbecker
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 18+ messages in thread
From: Frederic Weisbecker @ 2012-07-06 12:00 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: LKML, Frederic Weisbecker, Alessio Igor Bogani, Andrew Morton,
	Avi Kivity, Chris Metcalf, Christoph Lameter, Geoff Levand,
	Gilad Ben Yossef, Hakan Akkan, H. Peter Anvin, Ingo Molnar,
	Josh Triplett, Kevin Hilman, Max Krasnyansky, Peter Zijlstra,
	Stephen Hemminger, Steven Rostedt, Sven-Thorsten Dietrich,
	Thomas Gleixner

Allow calls to rcu_user_enter() even if we are already
in userspace (as seen by RCU) and allow calls to rcu_user_exit()
even if we are already in the kernel.

This makes the APIs more flexible to be called from architectures.
Exception entries for example won't need to know if they come from
userspace before calling rcu_user_exit().

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Alessio Igor Bogani <abogani@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Avi Kivity <avi@redhat.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: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Max Krasnyansky <maxk@qualcomm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/rcutree.c |   38 ++++++++++++++++++++++++++++++--------
 1 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 64fc2cd..81a86ec 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -344,6 +344,10 @@ static int rcu_implicit_offline_qs(struct rcu_data *rdp)
 	return 0;
 }
 
+#ifdef CONFIG_RCU_USER_QS
+static DEFINE_PER_CPU(bool, in_user);
+#endif
+
 /*
  * rcu_eqs_enter_common - current CPU is moving towards extended quiescent state
  *
@@ -389,11 +393,9 @@ static void rcu_eqs_enter_common(struct rcu_dynticks *rdtp, long long oldval,
  */
 static void rcu_eqs_enter(bool user)
 {
-	unsigned long flags;
 	long long oldval;
 	struct rcu_dynticks *rdtp;
 
-	local_irq_save(flags);
 	rdtp = &__get_cpu_var(rcu_dynticks);
 	oldval = rdtp->dynticks_nesting;
 	WARN_ON_ONCE((oldval & DYNTICK_TASK_NEST_MASK) == 0);
@@ -402,7 +404,6 @@ static void rcu_eqs_enter(bool user)
 	else
 		rdtp->dynticks_nesting -= DYNTICK_TASK_NEST_VALUE;
 	rcu_eqs_enter_common(rdtp, oldval, user);
-	local_irq_restore(flags);
 }
 
 /**
@@ -419,7 +420,11 @@ static void rcu_eqs_enter(bool user)
  */
 void rcu_idle_enter(void)
 {
+	unsigned long flags;
+
+	local_irq_save(flags);
 	rcu_eqs_enter(0);
+	local_irq_restore(flags);
 }
 EXPORT_SYMBOL_GPL(rcu_idle_enter);
 
@@ -434,7 +439,16 @@ EXPORT_SYMBOL_GPL(rcu_idle_enter);
  */
 void rcu_user_enter(void)
 {
-	rcu_eqs_enter(1);
+	unsigned long flags;
+
+	WARN_ON_ONCE(!current->mm);
+
+	local_irq_save(flags);
+	if (!this_cpu_read(in_user)) {
+		this_cpu_write(in_user, true);
+		rcu_eqs_enter(1);
+	}
+	local_irq_restore(flags);
 }
 EXPORT_SYMBOL_GPL(rcu_user_enter);
 #endif
@@ -530,11 +544,9 @@ static void rcu_eqs_exit_common(struct rcu_dynticks *rdtp, long long oldval,
  */
 static void rcu_eqs_exit(bool user)
 {
-	unsigned long flags;
 	struct rcu_dynticks *rdtp;
 	long long oldval;
 
-	local_irq_save(flags);
 	rdtp = &__get_cpu_var(rcu_dynticks);
 	oldval = rdtp->dynticks_nesting;
 	WARN_ON_ONCE(oldval < 0);
@@ -543,7 +555,6 @@ static void rcu_eqs_exit(bool user)
 	else
 		rdtp->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE;
 	rcu_eqs_exit_common(rdtp, oldval, user);
-	local_irq_restore(flags);
 }
 
 /**
@@ -559,7 +570,11 @@ static void rcu_eqs_exit(bool user)
  */
 void rcu_idle_exit(void)
 {
+	unsigned long flags;
+
+	local_irq_save(flags);
 	rcu_eqs_exit(0);
+	local_irq_restore(flags);
 }
 EXPORT_SYMBOL_GPL(rcu_idle_exit);
 
@@ -572,7 +587,14 @@ EXPORT_SYMBOL_GPL(rcu_idle_exit);
  */
 void rcu_user_exit(void)
 {
-	rcu_eqs_exit(1);
+	unsigned long flags;
+
+	local_irq_save(flags);
+	if (this_cpu_read(in_user)) {
+		this_cpu_write(in_user, false);
+		rcu_eqs_exit(1);
+	}
+	local_irq_restore(flags);
 }
 EXPORT_SYMBOL_GPL(rcu_user_exit);
 #endif
-- 
1.7.5.4


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

* [PATCH 3/6] rcu: Exit RCU extended QS on preemption in irq exit
  2012-07-06 12:00 [RFC PATCH 0/6] rcu: Userspace RCU extended quiescent state Frederic Weisbecker
  2012-07-06 12:00 ` [PATCH 1/6] rcu: Settle config for userspace " Frederic Weisbecker
  2012-07-06 12:00 ` [PATCH 2/6] rcu: Allow rcu_user_enter()/exit() to nest Frederic Weisbecker
@ 2012-07-06 12:00 ` Frederic Weisbecker
  2012-07-06 12:00 ` [PATCH 4/6] x86: Use the new schedule_user API on user preemption Frederic Weisbecker
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Frederic Weisbecker @ 2012-07-06 12:00 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: LKML, Frederic Weisbecker, Alessio Igor Bogani, Andrew Morton,
	Avi Kivity, Chris Metcalf, Christoph Lameter, Geoff Levand,
	Gilad Ben Yossef, Hakan Akkan, H. Peter Anvin, Ingo Molnar,
	Josh Triplett, Kevin Hilman, Max Krasnyansky, Peter Zijlstra,
	Stephen Hemminger, Steven Rostedt, Sven-Thorsten Dietrich,
	Thomas Gleixner

Syscalls and exceptions low level handlers must be contained
between rcu_user_exit() and rcu_user_enter(). But irq high
level handlers are already protected inside rcu_irq_enter/exit()
so we don't need to call rcu_user_exit() on irq entry. But if
we preempt the running task in the end of the interrupt, we need
to exit the RCU userspace mode because schedule() itself and the
next task are in the kernel and may contain RCU read side critical
section..

To solve this, call rcu_user_exit() from irq exit preemption points:
- If we interrupted kernelspace, we call preempt_schedule_irq() and
rcu_user_exit() is called from it.

- If we interrupted userspace, we usually call schedule() directly.
Now we will rely on a new API schedule_user() which calls rcu_user_exit()
before calling schedule().

The low level irq handler may need to call rcu_user_enter() if we
resume userspace after the task is woken up from its preemption.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Alessio Igor Bogani <abogani@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Avi Kivity <avi@redhat.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: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Max Krasnyansky <maxk@qualcomm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/sched/core.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index d5594a4..1630532 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3332,6 +3332,12 @@ asmlinkage void __sched schedule(void)
 }
 EXPORT_SYMBOL(schedule);
 
+asmlinkage void __sched schedule_user(void)
+{
+	rcu_user_exit();
+	schedule();
+}
+
 /**
  * schedule_preempt_disabled - called with preemption disabled
  *
@@ -3433,6 +3439,7 @@ asmlinkage void __sched preempt_schedule_irq(void)
 	/* Catch callers which need to be fixed */
 	BUG_ON(ti->preempt_count || !irqs_disabled());
 
+	rcu_user_exit();
 	do {
 		add_preempt_count(PREEMPT_ACTIVE);
 		local_irq_enable();
-- 
1.7.5.4


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

* [PATCH 4/6] x86: Use the new schedule_user API on user preemption
  2012-07-06 12:00 [RFC PATCH 0/6] rcu: Userspace RCU extended quiescent state Frederic Weisbecker
                   ` (2 preceding siblings ...)
  2012-07-06 12:00 ` [PATCH 3/6] rcu: Exit RCU extended QS on preemption in irq exit Frederic Weisbecker
@ 2012-07-06 12:00 ` Frederic Weisbecker
  2012-07-06 12:00 ` [PATCH 5/6] x86: Kernel entry/exit hooks for RCU Frederic Weisbecker
  2012-07-06 12:00 ` [PATCH 6/6] x86: Exit RCU extended QS on notify resume Frederic Weisbecker
  5 siblings, 0 replies; 18+ messages in thread
From: Frederic Weisbecker @ 2012-07-06 12:00 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: LKML, Frederic Weisbecker, Alessio Igor Bogani, Andrew Morton,
	Avi Kivity, Chris Metcalf, Christoph Lameter, Geoff Levand,
	Gilad Ben Yossef, Hakan Akkan, H. Peter Anvin, Ingo Molnar,
	Josh Triplett, Kevin Hilman, Max Krasnyansky, Peter Zijlstra,
	Stephen Hemminger, Steven Rostedt, Sven-Thorsten Dietrich,
	Thomas Gleixner

This way we can exit the RCU extended quiescent state before
we schedule a new task from irq exit.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Alessio Igor Bogani <abogani@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Avi Kivity <avi@redhat.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: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Max Krasnyansky <maxk@qualcomm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/entry_64.S |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 7d65133..e97d42d 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -565,7 +565,7 @@ sysret_careful:
 	TRACE_IRQS_ON
 	ENABLE_INTERRUPTS(CLBR_NONE)
 	pushq_cfi %rdi
-	call schedule
+	call schedule_user
 	popq_cfi %rdi
 	jmp sysret_check
 
@@ -678,7 +678,7 @@ int_careful:
 	TRACE_IRQS_ON
 	ENABLE_INTERRUPTS(CLBR_NONE)
 	pushq_cfi %rdi
-	call schedule
+	call schedule_user
 	popq_cfi %rdi
 	DISABLE_INTERRUPTS(CLBR_NONE)
 	TRACE_IRQS_OFF
@@ -974,7 +974,7 @@ retint_careful:
 	TRACE_IRQS_ON
 	ENABLE_INTERRUPTS(CLBR_NONE)
 	pushq_cfi %rdi
-	call  schedule
+	call  schedule_user
 	popq_cfi %rdi
 	GET_THREAD_INFO(%rcx)
 	DISABLE_INTERRUPTS(CLBR_NONE)
@@ -1467,7 +1467,7 @@ paranoid_userspace:
 paranoid_schedule:
 	TRACE_IRQS_ON
 	ENABLE_INTERRUPTS(CLBR_ANY)
-	call schedule
+	call schedule_user
 	DISABLE_INTERRUPTS(CLBR_ANY)
 	TRACE_IRQS_OFF
 	jmp paranoid_userspace
-- 
1.7.5.4


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

* [PATCH 5/6] x86: Kernel entry/exit hooks for RCU
  2012-07-06 12:00 [RFC PATCH 0/6] rcu: Userspace RCU extended quiescent state Frederic Weisbecker
                   ` (3 preceding siblings ...)
  2012-07-06 12:00 ` [PATCH 4/6] x86: Use the new schedule_user API on user preemption Frederic Weisbecker
@ 2012-07-06 12:00 ` Frederic Weisbecker
  2012-07-06 12:00 ` [PATCH 6/6] x86: Exit RCU extended QS on notify resume Frederic Weisbecker
  5 siblings, 0 replies; 18+ messages in thread
From: Frederic Weisbecker @ 2012-07-06 12:00 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: LKML, Frederic Weisbecker, Alessio Igor Bogani, Andrew Morton,
	Avi Kivity, Chris Metcalf, Christoph Lameter, Geoff Levand,
	Gilad Ben Yossef, Hakan Akkan, H. Peter Anvin, Ingo Molnar,
	Josh Triplett, Kevin Hilman, Max Krasnyansky, Peter Zijlstra,
	Stephen Hemminger, Steven Rostedt, Sven-Thorsten Dietrich,
	Thomas Gleixner

Hook on kernel boundaries from syscall/exception entry/exit
and irq exit to implement RCU userspace extended quiescent
state.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Alessio Igor Bogani <abogani@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Avi Kivity <avi@redhat.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: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Max Krasnyansky <maxk@qualcomm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/rcu.h |    7 +++++++
 arch/x86/kernel/entry_64.S |   25 +++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)
 create mode 100644 arch/x86/include/asm/rcu.h

diff --git a/arch/x86/include/asm/rcu.h b/arch/x86/include/asm/rcu.h
new file mode 100644
index 0000000..8ad018a
--- /dev/null
+++ b/arch/x86/include/asm/rcu.h
@@ -0,0 +1,7 @@
+#ifdef CONFIG_RCU_USER_QS
+# define ENTER_KERNEL callq rcu_user_exit
+# define EXIT_KERNEL callq rcu_user_enter
+#else
+# define ENTER_KERNEL
+# define EXIT_KERNEL
+#endif
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index e97d42d..677a808 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -56,6 +56,7 @@
 #include <asm/ftrace.h>
 #include <asm/percpu.h>
 #include <asm/asm.h>
+#include <asm/rcu.h>
 #include <linux/err.h>
 
 /* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this.  */
@@ -517,6 +518,22 @@ GLOBAL(system_call_after_swapgs)
 	movq  %rax,ORIG_RAX-ARGOFFSET(%rsp)
 	movq  %rcx,RIP-ARGOFFSET(%rsp)
 	CFI_REL_OFFSET rip,RIP-ARGOFFSET
+#ifdef CONFIG_RCU_USER_QS
+	ENTER_KERNEL
+	/*
+	 * Syscall args/scratch reg might have been
+	 * clobbered by rcu_user_exit() call. Restore
+	 * them.
+	 */
+	movq RDI-ARGOFFSET(%rsp), %rdi
+	movq RSI-ARGOFFSET(%rsp), %rsi
+	movq RDX-ARGOFFSET(%rsp), %rdx
+	movq R8-ARGOFFSET(%rsp), %r8
+	movq R9-ARGOFFSET(%rsp), %r9
+	movq ORIG_RAX-ARGOFFSET(%rsp), %rax
+	movq R10-ARGOFFSET(%rsp), %r10
+	movq R11-ARGOFFSET(%rsp), %r11
+#endif
 	testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
 	jnz tracesys
 system_call_fastpath:
@@ -544,6 +561,7 @@ sysret_check:
 	movl TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET),%edx
 	andl %edi,%edx
 	jnz  sysret_careful
+	EXIT_KERNEL
 	CFI_REMEMBER_STATE
 	/*
 	 * sysretq will re-enable interrupts:
@@ -925,6 +943,7 @@ retint_swapgs:		/* return to user-space */
 	 */
 	DISABLE_INTERRUPTS(CLBR_ANY)
 	TRACE_IRQS_IRETQ
+	EXIT_KERNEL
 	SWAPGS
 	jmp restore_args
 
@@ -1101,6 +1120,7 @@ ENTRY(\sym)
 	subq $ORIG_RAX-R15, %rsp
 	CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
 	call error_entry
+	ENTER_KERNEL
 	DEFAULT_FRAME 0
 	movq %rsp,%rdi		/* pt_regs pointer */
 	xorl %esi,%esi		/* no error code */
@@ -1119,6 +1139,7 @@ ENTRY(\sym)
 	CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
 	call save_paranoid
 	TRACE_IRQS_OFF
+	ENTER_KERNEL
 	movq %rsp,%rdi		/* pt_regs pointer */
 	xorl %esi,%esi		/* no error code */
 	call \do_sym
@@ -1137,6 +1158,7 @@ ENTRY(\sym)
 	CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
 	call save_paranoid
 	TRACE_IRQS_OFF_DEBUG
+	ENTER_KERNEL
 	movq %rsp,%rdi		/* pt_regs pointer */
 	xorl %esi,%esi		/* no error code */
 	subq $EXCEPTION_STKSZ, INIT_TSS_IST(\ist)
@@ -1154,6 +1176,7 @@ ENTRY(\sym)
 	subq $ORIG_RAX-R15, %rsp
 	CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
 	call error_entry
+	ENTER_KERNEL
 	DEFAULT_FRAME 0
 	movq %rsp,%rdi			/* pt_regs pointer */
 	movq ORIG_RAX(%rsp),%rsi	/* get error code */
@@ -1172,6 +1195,7 @@ ENTRY(\sym)
 	subq $ORIG_RAX-R15, %rsp
 	CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
 	call save_paranoid
+	ENTER_KERNEL
 	DEFAULT_FRAME 0
 	TRACE_IRQS_OFF
 	movq %rsp,%rdi			/* pt_regs pointer */
@@ -1437,6 +1461,7 @@ ENTRY(paranoid_exit)
 	testl $3,CS(%rsp)
 	jnz   paranoid_userspace
 paranoid_swapgs:
+	EXIT_KERNEL
 	TRACE_IRQS_IRETQ 0
 	SWAPGS_UNSAFE_STACK
 	RESTORE_ALL 8
-- 
1.7.5.4


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

* [PATCH 6/6] x86: Exit RCU extended QS on notify resume
  2012-07-06 12:00 [RFC PATCH 0/6] rcu: Userspace RCU extended quiescent state Frederic Weisbecker
                   ` (4 preceding siblings ...)
  2012-07-06 12:00 ` [PATCH 5/6] x86: Kernel entry/exit hooks for RCU Frederic Weisbecker
@ 2012-07-06 12:00 ` Frederic Weisbecker
  2012-07-06 16:33   ` Paul E. McKenney
  5 siblings, 1 reply; 18+ messages in thread
From: Frederic Weisbecker @ 2012-07-06 12:00 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: LKML, Frederic Weisbecker, Alessio Igor Bogani, Andrew Morton,
	Avi Kivity, Chris Metcalf, Christoph Lameter, Geoff Levand,
	Gilad Ben Yossef, Hakan Akkan, H. Peter Anvin, Ingo Molnar,
	Josh Triplett, Kevin Hilman, Max Krasnyansky, Peter Zijlstra,
	Stephen Hemminger, Steven Rostedt, Sven-Thorsten Dietrich,
	Thomas Gleixner

do_notify_resume() may be called on irq exit but it won't
be protected between rcu_irq_enter() and rcu_irq_exit()
and we don't call rcu_user_exit() on irq entry (unlike
syscalls/exceptions entry).

Since it can use RCU read side critical section, we must call
rcu_user_exit() before doing anything there.

This complete support for RCU userspace extended quiescent state
in x86.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Alessio Igor Bogani <abogani@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Avi Kivity <avi@redhat.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: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Max Krasnyansky <maxk@qualcomm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/Kconfig         |    1 +
 arch/x86/kernel/signal.c |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c70684f..38dfcc2 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -95,6 +95,7 @@ config X86
 	select KTIME_SCALAR if X86_32
 	select GENERIC_STRNCPY_FROM_USER
 	select GENERIC_STRNLEN_USER
+	select HAVE_RCU_USER_QS if X86_64
 
 config INSTRUCTION_DECODER
 	def_bool (KPROBES || PERF_EVENTS || UPROBES)
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 21af737..5af078e 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -776,6 +776,8 @@ static void do_signal(struct pt_regs *regs)
 void
 do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
 {
+	rcu_user_exit();
+
 #ifdef CONFIG_X86_MCE
 	/* notify userspace of pending MCEs */
 	if (thread_info_flags & _TIF_MCE_NOTIFY)
-- 
1.7.5.4


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

* Re: [PATCH 2/6] rcu: Allow rcu_user_enter()/exit() to nest
  2012-07-06 12:00 ` [PATCH 2/6] rcu: Allow rcu_user_enter()/exit() to nest Frederic Weisbecker
@ 2012-07-06 16:27   ` Paul E. McKenney
  2012-07-09 17:39     ` Frederic Weisbecker
  2012-07-08 15:54   ` Avi Kivity
  1 sibling, 1 reply; 18+ messages in thread
From: Paul E. McKenney @ 2012-07-06 16:27 UTC (permalink / raw)
  To: Frederic Weisbecker
  Cc: LKML, Alessio Igor Bogani, Andrew Morton, Avi Kivity,
	Chris Metcalf, Christoph Lameter, Geoff Levand, Gilad Ben Yossef,
	Hakan Akkan, H. Peter Anvin, Ingo Molnar, Josh Triplett,
	Kevin Hilman, Max Krasnyansky, Peter Zijlstra, Stephen Hemminger,
	Steven Rostedt, Sven-Thorsten Dietrich, Thomas Gleixner

On Fri, Jul 06, 2012 at 02:00:14PM +0200, Frederic Weisbecker wrote:
> Allow calls to rcu_user_enter() even if we are already
> in userspace (as seen by RCU) and allow calls to rcu_user_exit()
> even if we are already in the kernel.
> 
> This makes the APIs more flexible to be called from architectures.
> Exception entries for example won't need to know if they come from
> userspace before calling rcu_user_exit().

You lost me on this one.  As long as the nesting level stays below
a few tens, rcu_user_enter() and rcu_user_exit() already can nest.

Or are you saying that you need to deal with duplicate rcu_user_enter()
calls that must be matched by a single rcu_user_exit() call?

						Thanx, Paul

> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Alessio Igor Bogani <abogani@kernel.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Avi Kivity <avi@redhat.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: H. Peter Anvin <hpa@zytor.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Kevin Hilman <khilman@ti.com>
> Cc: Max Krasnyansky <maxk@qualcomm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Stephen Hemminger <shemminger@vyatta.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> ---
>  kernel/rcutree.c |   38 ++++++++++++++++++++++++++++++--------
>  1 files changed, 30 insertions(+), 8 deletions(-)
> 
> diff --git a/kernel/rcutree.c b/kernel/rcutree.c
> index 64fc2cd..81a86ec 100644
> --- a/kernel/rcutree.c
> +++ b/kernel/rcutree.c
> @@ -344,6 +344,10 @@ static int rcu_implicit_offline_qs(struct rcu_data *rdp)
>  	return 0;
>  }
> 
> +#ifdef CONFIG_RCU_USER_QS
> +static DEFINE_PER_CPU(bool, in_user);
> +#endif
> +
>  /*
>   * rcu_eqs_enter_common - current CPU is moving towards extended quiescent state
>   *
> @@ -389,11 +393,9 @@ static void rcu_eqs_enter_common(struct rcu_dynticks *rdtp, long long oldval,
>   */
>  static void rcu_eqs_enter(bool user)
>  {
> -	unsigned long flags;
>  	long long oldval;
>  	struct rcu_dynticks *rdtp;
> 
> -	local_irq_save(flags);
>  	rdtp = &__get_cpu_var(rcu_dynticks);
>  	oldval = rdtp->dynticks_nesting;
>  	WARN_ON_ONCE((oldval & DYNTICK_TASK_NEST_MASK) == 0);
> @@ -402,7 +404,6 @@ static void rcu_eqs_enter(bool user)
>  	else
>  		rdtp->dynticks_nesting -= DYNTICK_TASK_NEST_VALUE;
>  	rcu_eqs_enter_common(rdtp, oldval, user);
> -	local_irq_restore(flags);
>  }
> 
>  /**
> @@ -419,7 +420,11 @@ static void rcu_eqs_enter(bool user)
>   */
>  void rcu_idle_enter(void)
>  {
> +	unsigned long flags;
> +
> +	local_irq_save(flags);
>  	rcu_eqs_enter(0);
> +	local_irq_restore(flags);
>  }
>  EXPORT_SYMBOL_GPL(rcu_idle_enter);
> 
> @@ -434,7 +439,16 @@ EXPORT_SYMBOL_GPL(rcu_idle_enter);
>   */
>  void rcu_user_enter(void)
>  {
> -	rcu_eqs_enter(1);
> +	unsigned long flags;
> +
> +	WARN_ON_ONCE(!current->mm);
> +
> +	local_irq_save(flags);
> +	if (!this_cpu_read(in_user)) {
> +		this_cpu_write(in_user, true);
> +		rcu_eqs_enter(1);
> +	}
> +	local_irq_restore(flags);
>  }
>  EXPORT_SYMBOL_GPL(rcu_user_enter);
>  #endif
> @@ -530,11 +544,9 @@ static void rcu_eqs_exit_common(struct rcu_dynticks *rdtp, long long oldval,
>   */
>  static void rcu_eqs_exit(bool user)
>  {
> -	unsigned long flags;
>  	struct rcu_dynticks *rdtp;
>  	long long oldval;
> 
> -	local_irq_save(flags);
>  	rdtp = &__get_cpu_var(rcu_dynticks);
>  	oldval = rdtp->dynticks_nesting;
>  	WARN_ON_ONCE(oldval < 0);
> @@ -543,7 +555,6 @@ static void rcu_eqs_exit(bool user)
>  	else
>  		rdtp->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE;
>  	rcu_eqs_exit_common(rdtp, oldval, user);
> -	local_irq_restore(flags);
>  }
> 
>  /**
> @@ -559,7 +570,11 @@ static void rcu_eqs_exit(bool user)
>   */
>  void rcu_idle_exit(void)
>  {
> +	unsigned long flags;
> +
> +	local_irq_save(flags);
>  	rcu_eqs_exit(0);
> +	local_irq_restore(flags);
>  }
>  EXPORT_SYMBOL_GPL(rcu_idle_exit);
> 
> @@ -572,7 +587,14 @@ EXPORT_SYMBOL_GPL(rcu_idle_exit);
>   */
>  void rcu_user_exit(void)
>  {
> -	rcu_eqs_exit(1);
> +	unsigned long flags;
> +
> +	local_irq_save(flags);
> +	if (this_cpu_read(in_user)) {
> +		this_cpu_write(in_user, false);
> +		rcu_eqs_exit(1);
> +	}
> +	local_irq_restore(flags);
>  }
>  EXPORT_SYMBOL_GPL(rcu_user_exit);
>  #endif
> -- 
> 1.7.5.4
> 


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

* Re: [PATCH 1/6] rcu: Settle config for userspace extended quiescent state
  2012-07-06 12:00 ` [PATCH 1/6] rcu: Settle config for userspace " Frederic Weisbecker
@ 2012-07-06 16:31   ` Paul E. McKenney
  2012-07-09 17:42     ` Frederic Weisbecker
  0 siblings, 1 reply; 18+ messages in thread
From: Paul E. McKenney @ 2012-07-06 16:31 UTC (permalink / raw)
  To: Frederic Weisbecker
  Cc: LKML, Alessio Igor Bogani, Andrew Morton, Avi Kivity,
	Chris Metcalf, Christoph Lameter, Geoff Levand, Gilad Ben Yossef,
	Hakan Akkan, H. Peter Anvin, Ingo Molnar, Josh Triplett,
	Kevin Hilman, Max Krasnyansky, Peter Zijlstra, Stephen Hemminger,
	Steven Rostedt, Sven-Thorsten Dietrich, Thomas Gleixner

On Fri, Jul 06, 2012 at 02:00:13PM +0200, Frederic Weisbecker wrote:
> Create a new config option under the RCU menu that put
> CPUs under RCU extended quiescent state (as in dynticks
> idle mode) when they run in userspace. This require
> some contribution from architectures to hook into kernel
> and userspace boundaries.
> 
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Alessio Igor Bogani <abogani@kernel.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Avi Kivity <avi@redhat.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: H. Peter Anvin <hpa@zytor.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Kevin Hilman <khilman@ti.com>
> Cc: Max Krasnyansky <maxk@qualcomm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Stephen Hemminger <shemminger@vyatta.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> ---
>  arch/Kconfig     |   13 +++++++++++++
>  init/Kconfig     |   10 ++++++++++
>  kernel/rcutree.c |    4 ++++
>  3 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/Kconfig b/arch/Kconfig
> index 8c3d957..c2e0ce4 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -274,4 +274,17 @@ config SECCOMP_FILTER
> 
>  	  See Documentation/prctl/seccomp_filter.txt for details.
> 
> +config HAVE_RCU_USER_QS
> +	bool
> +	help
> +	  Provide kernel entry/exit hooks necessary for userspace
> +	  RCU extended quiescent state. Syscalls and exceptions
> +	  low level handlers must be wrapped with a call to rcu_user_exit()
> +	  on entry and rcu_user_enter() before resuming userspace. Irqs
> +	  entry don't need to call rcu_user_exit() because their high level
> +	  handlers are protected inside rcu_irq_enter/rcu_irq_exit() but
> +	  preemption or signal handling on irq exit still need to be protected
> +	  with a call to rcu_user_exit(). rcu_user_enter() must then be
> +	  called back on irq exit when the preempted task is back on the CPU.
> +
>  source "kernel/gcov/Kconfig"
> diff --git a/init/Kconfig b/init/Kconfig
> index d07dcf9..3a4af8f 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -441,6 +441,16 @@ config PREEMPT_RCU
>  	  This option enables preemptible-RCU code that is common between
>  	  the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations.
> 
> +config RCU_USER_QS
> +	bool "Consider userspace as in RCU extended quiescent state"
> +	depends on HAVE_RCU_USER_QS && SMP

OK, I'll bite...  Why the "SMP"?  RCU could make good use of knowing
about user-mode executing even in UP kernels.

> +	help
> +	  This option sets hooks on kernel / userspace boundaries and
> +	  puts RCU in extended quiescent state when the CPU runs in
> +	  userspace. It means that when a CPU runs in userspace, it is
> +	  excluded from the global RCU state machine and thus doesn't
> +	  need to keep the timer tick on for RCU.
> +
>  config RCU_FANOUT
>  	int "Tree-based hierarchical RCU fanout value"
>  	range 2 64 if 64BIT
> diff --git a/kernel/rcutree.c b/kernel/rcutree.c
> index 5541a07..64fc2cd 100644
> --- a/kernel/rcutree.c
> +++ b/kernel/rcutree.c
> @@ -423,6 +423,7 @@ void rcu_idle_enter(void)
>  }
>  EXPORT_SYMBOL_GPL(rcu_idle_enter);
> 
> +#ifdef CONFIG_RCU_USER_QS
>  /**
>   * rcu_user_enter - inform RCU that we are resuming userspace.
>   *
> @@ -436,6 +437,7 @@ void rcu_user_enter(void)
>  	rcu_eqs_enter(1);
>  }
>  EXPORT_SYMBOL_GPL(rcu_user_enter);
> +#endif
> 
> 
>  /**
> @@ -561,6 +563,7 @@ void rcu_idle_exit(void)
>  }
>  EXPORT_SYMBOL_GPL(rcu_idle_exit);
> 
> +#ifdef CONFIG_RCU_USER_QS
>  /**
>   * rcu_user_exit - inform RCU that we are exiting userspace.
>   *
> @@ -572,6 +575,7 @@ void rcu_user_exit(void)
>  	rcu_eqs_exit(1);
>  }
>  EXPORT_SYMBOL_GPL(rcu_user_exit);
> +#endif
> 
>  /**
>   * rcu_user_exit_irq - inform RCU that we won't resume to userspace
> -- 
> 1.7.5.4
> 


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

* Re: [PATCH 6/6] x86: Exit RCU extended QS on notify resume
  2012-07-06 12:00 ` [PATCH 6/6] x86: Exit RCU extended QS on notify resume Frederic Weisbecker
@ 2012-07-06 16:33   ` Paul E. McKenney
  2012-07-06 20:43     ` Josh Triplett
  2012-07-09 17:43     ` Frederic Weisbecker
  0 siblings, 2 replies; 18+ messages in thread
From: Paul E. McKenney @ 2012-07-06 16:33 UTC (permalink / raw)
  To: Frederic Weisbecker
  Cc: LKML, Alessio Igor Bogani, Andrew Morton, Avi Kivity,
	Chris Metcalf, Christoph Lameter, Geoff Levand, Gilad Ben Yossef,
	Hakan Akkan, H. Peter Anvin, Ingo Molnar, Josh Triplett,
	Kevin Hilman, Max Krasnyansky, Peter Zijlstra, Stephen Hemminger,
	Steven Rostedt, Sven-Thorsten Dietrich, Thomas Gleixner

On Fri, Jul 06, 2012 at 02:00:18PM +0200, Frederic Weisbecker wrote:
> do_notify_resume() may be called on irq exit but it won't
> be protected between rcu_irq_enter() and rcu_irq_exit()
> and we don't call rcu_user_exit() on irq entry (unlike
> syscalls/exceptions entry).
> 
> Since it can use RCU read side critical section, we must call
> rcu_user_exit() before doing anything there.
> 
> This complete support for RCU userspace extended quiescent state
> in x86.
> 
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Alessio Igor Bogani <abogani@kernel.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Avi Kivity <avi@redhat.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: H. Peter Anvin <hpa@zytor.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Kevin Hilman <khilman@ti.com>
> Cc: Max Krasnyansky <maxk@qualcomm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Stephen Hemminger <shemminger@vyatta.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> ---
>  arch/x86/Kconfig         |    1 +
>  arch/x86/kernel/signal.c |    2 ++
>  2 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index c70684f..38dfcc2 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -95,6 +95,7 @@ config X86
>  	select KTIME_SCALAR if X86_32
>  	select GENERIC_STRNCPY_FROM_USER
>  	select GENERIC_STRNLEN_USER
> +	select HAVE_RCU_USER_QS if X86_64

And I will bite yet again.  Why only 64-bit kernels?

							Thanx, Paul

>  config INSTRUCTION_DECODER
>  	def_bool (KPROBES || PERF_EVENTS || UPROBES)
> diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
> index 21af737..5af078e 100644
> --- a/arch/x86/kernel/signal.c
> +++ b/arch/x86/kernel/signal.c
> @@ -776,6 +776,8 @@ static void do_signal(struct pt_regs *regs)
>  void
>  do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
>  {
> +	rcu_user_exit();
> +
>  #ifdef CONFIG_X86_MCE
>  	/* notify userspace of pending MCEs */
>  	if (thread_info_flags & _TIF_MCE_NOTIFY)
> -- 
> 1.7.5.4
> 


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

* Re: [PATCH 6/6] x86: Exit RCU extended QS on notify resume
  2012-07-06 16:33   ` Paul E. McKenney
@ 2012-07-06 20:43     ` Josh Triplett
  2012-07-08 21:17       ` Paul E. McKenney
  2012-07-09 17:43     ` Frederic Weisbecker
  1 sibling, 1 reply; 18+ messages in thread
From: Josh Triplett @ 2012-07-06 20:43 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Frederic Weisbecker, LKML, Alessio Igor Bogani, Andrew Morton,
	Avi Kivity, Chris Metcalf, Christoph Lameter, Geoff Levand,
	Gilad Ben Yossef, Hakan Akkan, H. Peter Anvin, Ingo Molnar,
	Kevin Hilman, Max Krasnyansky, Peter Zijlstra, Stephen Hemminger,
	Steven Rostedt, Sven-Thorsten Dietrich, Thomas Gleixner

On Fri, Jul 06, 2012 at 09:33:38AM -0700, Paul E. McKenney wrote:
> On Fri, Jul 06, 2012 at 02:00:18PM +0200, Frederic Weisbecker wrote:
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -95,6 +95,7 @@ config X86
> >  	select KTIME_SCALAR if X86_32
> >  	select GENERIC_STRNCPY_FROM_USER
> >  	select GENERIC_STRNLEN_USER
> > +	select HAVE_RCU_USER_QS if X86_64
> 
> And I will bite yet again.  Why only 64-bit kernels?

Because HAVE_RCU_USER_QS requires an architecture-specific component,
and this patch series only added the necessary bits to entry_64.S.

- Josh Triplett

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

* Re: [PATCH 2/6] rcu: Allow rcu_user_enter()/exit() to nest
  2012-07-06 12:00 ` [PATCH 2/6] rcu: Allow rcu_user_enter()/exit() to nest Frederic Weisbecker
  2012-07-06 16:27   ` Paul E. McKenney
@ 2012-07-08 15:54   ` Avi Kivity
  2012-07-09 17:45     ` Frederic Weisbecker
  1 sibling, 1 reply; 18+ messages in thread
From: Avi Kivity @ 2012-07-08 15:54 UTC (permalink / raw)
  To: Frederic Weisbecker
  Cc: Paul E. McKenney, LKML, Alessio Igor Bogani, Andrew Morton,
	Chris Metcalf, Christoph Lameter, Geoff Levand, Gilad Ben Yossef,
	Hakan Akkan, H. Peter Anvin, Ingo Molnar, Josh Triplett,
	Kevin Hilman, Max Krasnyansky, Peter Zijlstra, Stephen Hemminger,
	Steven Rostedt, Sven-Thorsten Dietrich, Thomas Gleixner,
	Marcelo Tosatti, KVM list

On 07/06/2012 03:00 PM, Frederic Weisbecker wrote:
> Allow calls to rcu_user_enter() even if we are already
> in userspace (as seen by RCU) and allow calls to rcu_user_exit()
> even if we are already in the kernel.
> 
> This makes the APIs more flexible to be called from architectures.
> Exception entries for example won't need to know if they come from
> userspace before calling rcu_user_exit().

I guess I should switch kvm to rcu_user_enter() and co, so we can
disable the tick while running in a guest.  But where are those
functions?  What are the rules for calling them?

-- 
error compiling committee.c: too many arguments to function



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

* Re: [PATCH 6/6] x86: Exit RCU extended QS on notify resume
  2012-07-06 20:43     ` Josh Triplett
@ 2012-07-08 21:17       ` Paul E. McKenney
  2012-07-10  9:18         ` Frederic Weisbecker
  0 siblings, 1 reply; 18+ messages in thread
From: Paul E. McKenney @ 2012-07-08 21:17 UTC (permalink / raw)
  To: Josh Triplett
  Cc: Frederic Weisbecker, LKML, Alessio Igor Bogani, Andrew Morton,
	Avi Kivity, Chris Metcalf, Christoph Lameter, Geoff Levand,
	Gilad Ben Yossef, Hakan Akkan, H. Peter Anvin, Ingo Molnar,
	Kevin Hilman, Max Krasnyansky, Peter Zijlstra, Stephen Hemminger,
	Steven Rostedt, Sven-Thorsten Dietrich, Thomas Gleixner

On Fri, Jul 06, 2012 at 01:43:29PM -0700, Josh Triplett wrote:
> On Fri, Jul 06, 2012 at 09:33:38AM -0700, Paul E. McKenney wrote:
> > On Fri, Jul 06, 2012 at 02:00:18PM +0200, Frederic Weisbecker wrote:
> > > --- a/arch/x86/Kconfig
> > > +++ b/arch/x86/Kconfig
> > > @@ -95,6 +95,7 @@ config X86
> > >  	select KTIME_SCALAR if X86_32
> > >  	select GENERIC_STRNCPY_FROM_USER
> > >  	select GENERIC_STRNLEN_USER
> > > +	select HAVE_RCU_USER_QS if X86_64
> > 
> > And I will bite yet again.  Why only 64-bit kernels?
> 
> Because HAVE_RCU_USER_QS requires an architecture-specific component,
> and this patch series only added the necessary bits to entry_64.S.

OK, please allow me to rephrase the question.  Why only entry_64.S?  ;-)

							Thanx, Paul


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

* Re: [PATCH 2/6] rcu: Allow rcu_user_enter()/exit() to nest
  2012-07-06 16:27   ` Paul E. McKenney
@ 2012-07-09 17:39     ` Frederic Weisbecker
  0 siblings, 0 replies; 18+ messages in thread
From: Frederic Weisbecker @ 2012-07-09 17:39 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: LKML, Alessio Igor Bogani, Andrew Morton, Avi Kivity,
	Chris Metcalf, Christoph Lameter, Geoff Levand, Gilad Ben Yossef,
	Hakan Akkan, H. Peter Anvin, Ingo Molnar, Josh Triplett,
	Kevin Hilman, Max Krasnyansky, Peter Zijlstra, Stephen Hemminger,
	Steven Rostedt, Sven-Thorsten Dietrich, Thomas Gleixner

On Fri, Jul 06, 2012 at 09:27:09AM -0700, Paul E. McKenney wrote:
> On Fri, Jul 06, 2012 at 02:00:14PM +0200, Frederic Weisbecker wrote:
> > Allow calls to rcu_user_enter() even if we are already
> > in userspace (as seen by RCU) and allow calls to rcu_user_exit()
> > even if we are already in the kernel.
> > 
> > This makes the APIs more flexible to be called from architectures.
> > Exception entries for example won't need to know if they come from
> > userspace before calling rcu_user_exit().
> 
> You lost me on this one.  As long as the nesting level stays below
> a few tens, rcu_user_enter() and rcu_user_exit() already can nest.
> 
> Or are you saying that you need to deal with duplicate rcu_user_enter()
> calls that must be matched by a single rcu_user_exit() call?

Yep, we can have that kind of thing:

in_user = 1
==== syscall
rcu_user_exit() // in_user = 0
	==== exception
	rcu_user_exit()
	==== end of exception
==== end of syscall
rcu_user_enter()

This is because when we enter an exception, we don't have a different
entry whenever we trapped/faulted in userspace or kernelspace. So it's hard
to know if we were in userspace before the exception triggered. To avoid
complication in architecture code, I'm using this kind of "in_user" state.

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

* Re: [PATCH 1/6] rcu: Settle config for userspace extended quiescent state
  2012-07-06 16:31   ` Paul E. McKenney
@ 2012-07-09 17:42     ` Frederic Weisbecker
  0 siblings, 0 replies; 18+ messages in thread
From: Frederic Weisbecker @ 2012-07-09 17:42 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: LKML, Alessio Igor Bogani, Andrew Morton, Avi Kivity,
	Chris Metcalf, Christoph Lameter, Geoff Levand, Gilad Ben Yossef,
	Hakan Akkan, H. Peter Anvin, Ingo Molnar, Josh Triplett,
	Kevin Hilman, Max Krasnyansky, Peter Zijlstra, Stephen Hemminger,
	Steven Rostedt, Sven-Thorsten Dietrich, Thomas Gleixner

On Fri, Jul 06, 2012 at 09:31:29AM -0700, Paul E. McKenney wrote:
> On Fri, Jul 06, 2012 at 02:00:13PM +0200, Frederic Weisbecker wrote:
> > Create a new config option under the RCU menu that put
> > CPUs under RCU extended quiescent state (as in dynticks
> > idle mode) when they run in userspace. This require
> > some contribution from architectures to hook into kernel
> > and userspace boundaries.
> > 
> > Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> > Cc: Alessio Igor Bogani <abogani@kernel.org>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Avi Kivity <avi@redhat.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: H. Peter Anvin <hpa@zytor.com>
> > Cc: Ingo Molnar <mingo@kernel.org>
> > Cc: Josh Triplett <josh@joshtriplett.org>
> > Cc: Kevin Hilman <khilman@ti.com>
> > Cc: Max Krasnyansky <maxk@qualcomm.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Stephen Hemminger <shemminger@vyatta.com>
> > Cc: Steven Rostedt <rostedt@goodmis.org>
> > Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > ---
> >  arch/Kconfig     |   13 +++++++++++++
> >  init/Kconfig     |   10 ++++++++++
> >  kernel/rcutree.c |    4 ++++
> >  3 files changed, 27 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/Kconfig b/arch/Kconfig
> > index 8c3d957..c2e0ce4 100644
> > --- a/arch/Kconfig
> > +++ b/arch/Kconfig
> > @@ -274,4 +274,17 @@ config SECCOMP_FILTER
> > 
> >  	  See Documentation/prctl/seccomp_filter.txt for details.
> > 
> > +config HAVE_RCU_USER_QS
> > +	bool
> > +	help
> > +	  Provide kernel entry/exit hooks necessary for userspace
> > +	  RCU extended quiescent state. Syscalls and exceptions
> > +	  low level handlers must be wrapped with a call to rcu_user_exit()
> > +	  on entry and rcu_user_enter() before resuming userspace. Irqs
> > +	  entry don't need to call rcu_user_exit() because their high level
> > +	  handlers are protected inside rcu_irq_enter/rcu_irq_exit() but
> > +	  preemption or signal handling on irq exit still need to be protected
> > +	  with a call to rcu_user_exit(). rcu_user_enter() must then be
> > +	  called back on irq exit when the preempted task is back on the CPU.
> > +
> >  source "kernel/gcov/Kconfig"
> > diff --git a/init/Kconfig b/init/Kconfig
> > index d07dcf9..3a4af8f 100644
> > --- a/init/Kconfig
> > +++ b/init/Kconfig
> > @@ -441,6 +441,16 @@ config PREEMPT_RCU
> >  	  This option enables preemptible-RCU code that is common between
> >  	  the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations.
> > 
> > +config RCU_USER_QS
> > +	bool "Consider userspace as in RCU extended quiescent state"
> > +	depends on HAVE_RCU_USER_QS && SMP
> 
> OK, I'll bite...  Why the "SMP"?  RCU could make good use of knowing
> about user-mode executing even in UP kernels.

Because Tiny RCU doesn't implement rcu_user_enter()/exit yet. And it
doesn't need it for now.

To better express the constraint I should probably have used:

	depends on TREE_RCU || TREE_PREEMPT_RCU

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

* Re: [PATCH 6/6] x86: Exit RCU extended QS on notify resume
  2012-07-06 16:33   ` Paul E. McKenney
  2012-07-06 20:43     ` Josh Triplett
@ 2012-07-09 17:43     ` Frederic Weisbecker
  1 sibling, 0 replies; 18+ messages in thread
From: Frederic Weisbecker @ 2012-07-09 17:43 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: LKML, Alessio Igor Bogani, Andrew Morton, Avi Kivity,
	Chris Metcalf, Christoph Lameter, Geoff Levand, Gilad Ben Yossef,
	Hakan Akkan, H. Peter Anvin, Ingo Molnar, Josh Triplett,
	Kevin Hilman, Max Krasnyansky, Peter Zijlstra, Stephen Hemminger,
	Steven Rostedt, Sven-Thorsten Dietrich, Thomas Gleixner

On Fri, Jul 06, 2012 at 09:33:38AM -0700, Paul E. McKenney wrote:
> On Fri, Jul 06, 2012 at 02:00:18PM +0200, Frederic Weisbecker wrote:
> > do_notify_resume() may be called on irq exit but it won't
> > be protected between rcu_irq_enter() and rcu_irq_exit()
> > and we don't call rcu_user_exit() on irq entry (unlike
> > syscalls/exceptions entry).
> > 
> > Since it can use RCU read side critical section, we must call
> > rcu_user_exit() before doing anything there.
> > 
> > This complete support for RCU userspace extended quiescent state
> > in x86.
> > 
> > Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> > Cc: Alessio Igor Bogani <abogani@kernel.org>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Avi Kivity <avi@redhat.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: H. Peter Anvin <hpa@zytor.com>
> > Cc: Ingo Molnar <mingo@kernel.org>
> > Cc: Josh Triplett <josh@joshtriplett.org>
> > Cc: Kevin Hilman <khilman@ti.com>
> > Cc: Max Krasnyansky <maxk@qualcomm.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Stephen Hemminger <shemminger@vyatta.com>
> > Cc: Steven Rostedt <rostedt@goodmis.org>
> > Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > ---
> >  arch/x86/Kconfig         |    1 +
> >  arch/x86/kernel/signal.c |    2 ++
> >  2 files changed, 3 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > index c70684f..38dfcc2 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -95,6 +95,7 @@ config X86
> >  	select KTIME_SCALAR if X86_32
> >  	select GENERIC_STRNCPY_FROM_USER
> >  	select GENERIC_STRNLEN_USER
> > +	select HAVE_RCU_USER_QS if X86_64
> 
> And I will bite yet again.  Why only 64-bit kernels?
> 
> 							Thanx, Paul

Because I don't want to spend time on implementing it the same way on 32
in case people disagree with the whole design :)

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

* Re: [PATCH 2/6] rcu: Allow rcu_user_enter()/exit() to nest
  2012-07-08 15:54   ` Avi Kivity
@ 2012-07-09 17:45     ` Frederic Weisbecker
  0 siblings, 0 replies; 18+ messages in thread
From: Frederic Weisbecker @ 2012-07-09 17:45 UTC (permalink / raw)
  To: Avi Kivity
  Cc: Paul E. McKenney, LKML, Alessio Igor Bogani, Andrew Morton,
	Chris Metcalf, Christoph Lameter, Geoff Levand, Gilad Ben Yossef,
	Hakan Akkan, H. Peter Anvin, Ingo Molnar, Josh Triplett,
	Kevin Hilman, Max Krasnyansky, Peter Zijlstra, Stephen Hemminger,
	Steven Rostedt, Sven-Thorsten Dietrich, Thomas Gleixner,
	Marcelo Tosatti, KVM list

On Sun, Jul 08, 2012 at 06:54:18PM +0300, Avi Kivity wrote:
> On 07/06/2012 03:00 PM, Frederic Weisbecker wrote:
> > Allow calls to rcu_user_enter() even if we are already
> > in userspace (as seen by RCU) and allow calls to rcu_user_exit()
> > even if we are already in the kernel.
> > 
> > This makes the APIs more flexible to be called from architectures.
> > Exception entries for example won't need to know if they come from
> > userspace before calling rcu_user_exit().
> 
> I guess I should switch kvm to rcu_user_enter() and co, so we can
> disable the tick while running in a guest.  But where are those
> functions?  What are the rules for calling them?

I guess we need to have a closer look at the guest case first. We probably need
to take some care about specifics in time and load accounting usually
handled by the tick before we can shut it down. RCU is only part of the
problem.

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

* Re: [PATCH 6/6] x86: Exit RCU extended QS on notify resume
  2012-07-08 21:17       ` Paul E. McKenney
@ 2012-07-10  9:18         ` Frederic Weisbecker
  0 siblings, 0 replies; 18+ messages in thread
From: Frederic Weisbecker @ 2012-07-10  9:18 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Josh Triplett, LKML, Alessio Igor Bogani, Andrew Morton,
	Avi Kivity, Chris Metcalf, Christoph Lameter, Geoff Levand,
	Gilad Ben Yossef, Hakan Akkan, H. Peter Anvin, Ingo Molnar,
	Kevin Hilman, Max Krasnyansky, Peter Zijlstra, Stephen Hemminger,
	Steven Rostedt, Sven-Thorsten Dietrich, Thomas Gleixner

On Sun, Jul 08, 2012 at 02:17:07PM -0700, Paul E. McKenney wrote:
> On Fri, Jul 06, 2012 at 01:43:29PM -0700, Josh Triplett wrote:
> > On Fri, Jul 06, 2012 at 09:33:38AM -0700, Paul E. McKenney wrote:
> > > On Fri, Jul 06, 2012 at 02:00:18PM +0200, Frederic Weisbecker wrote:
> > > > --- a/arch/x86/Kconfig
> > > > +++ b/arch/x86/Kconfig
> > > > @@ -95,6 +95,7 @@ config X86
> > > >  	select KTIME_SCALAR if X86_32
> > > >  	select GENERIC_STRNCPY_FROM_USER
> > > >  	select GENERIC_STRNLEN_USER
> > > > +	select HAVE_RCU_USER_QS if X86_64
> > > 
> > > And I will bite yet again.  Why only 64-bit kernels?
> > 
> > Because HAVE_RCU_USER_QS requires an architecture-specific component,
> > and this patch series only added the necessary bits to entry_64.S.
> 
> OK, please allow me to rephrase the question.  Why only entry_64.S?  ;-)

So like I said, I prefer to wait for reviews and general opinion before
pushing further.

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

end of thread, other threads:[~2012-07-10  9:18 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-06 12:00 [RFC PATCH 0/6] rcu: Userspace RCU extended quiescent state Frederic Weisbecker
2012-07-06 12:00 ` [PATCH 1/6] rcu: Settle config for userspace " Frederic Weisbecker
2012-07-06 16:31   ` Paul E. McKenney
2012-07-09 17:42     ` Frederic Weisbecker
2012-07-06 12:00 ` [PATCH 2/6] rcu: Allow rcu_user_enter()/exit() to nest Frederic Weisbecker
2012-07-06 16:27   ` Paul E. McKenney
2012-07-09 17:39     ` Frederic Weisbecker
2012-07-08 15:54   ` Avi Kivity
2012-07-09 17:45     ` Frederic Weisbecker
2012-07-06 12:00 ` [PATCH 3/6] rcu: Exit RCU extended QS on preemption in irq exit Frederic Weisbecker
2012-07-06 12:00 ` [PATCH 4/6] x86: Use the new schedule_user API on user preemption Frederic Weisbecker
2012-07-06 12:00 ` [PATCH 5/6] x86: Kernel entry/exit hooks for RCU Frederic Weisbecker
2012-07-06 12:00 ` [PATCH 6/6] x86: Exit RCU extended QS on notify resume Frederic Weisbecker
2012-07-06 16:33   ` Paul E. McKenney
2012-07-06 20:43     ` Josh Triplett
2012-07-08 21:17       ` Paul E. McKenney
2012-07-10  9:18         ` Frederic Weisbecker
2012-07-09 17:43     ` Frederic Weisbecker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.