Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa34da70 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge branch 'rcu/idle' of...

Merge branch 'rcu/idle' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu

 into core/rcu

Pull the RCU adaptive-idle feature from Paul E. McKenney:

 "This series adds RCU APIs that allow non-idle tasks to
  enter RCU idle mode and provides x86 code to make use of them, allowing
  RCU to treat user-mode execution as an extended quiescent state when the
  new RCU_USER_QS kernel configuration parameter is specified.  Work is
  in progress to port this to a few other architectures, but is not part
  of this series."

Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents a9b86fab cb349ca9
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -281,4 +281,14 @@ 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 need to be wrapped inside
	  rcu_user_exit()-rcu_user_enter() through the slow path using
	  TIF_NOHZ flag. Exceptions handlers must be wrapped as well. Irqs
	  are already protected inside rcu_irq_enter/rcu_irq_exit() but
	  preemption or signal handling on irq exit still need to be protected.

source "kernel/gcov/Kconfig"
+1 −0
Original line number Diff line number Diff line
@@ -705,6 +705,7 @@ static void stack_proc(void *arg)
	struct task_struct *from = current, *to = arg;

	to->thread.saved_task = from;
	rcu_switch(from, to);
	switch_to(from, to, from);
}

+1 −0
Original line number Diff line number Diff line
@@ -97,6 +97,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)
+32 −0
Original line number Diff line number Diff line
#ifndef _ASM_X86_RCU_H
#define _ASM_X86_RCU_H

#ifndef __ASSEMBLY__

#include <linux/rcupdate.h>
#include <asm/ptrace.h>

static inline void exception_enter(struct pt_regs *regs)
{
	rcu_user_exit();
}

static inline void exception_exit(struct pt_regs *regs)
{
#ifdef CONFIG_RCU_USER_QS
	if (user_mode(regs))
		rcu_user_enter();
#endif
}

#else /* __ASSEMBLY__ */

#ifdef CONFIG_RCU_USER_QS
# define SCHEDULE_USER call schedule_user
#else
# define SCHEDULE_USER call schedule
#endif

#endif /* !__ASSEMBLY__ */

#endif
+7 −3
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ struct thread_info {
#define TIF_NOTSC		16	/* TSC is not accessible in userland */
#define TIF_IA32		17	/* IA32 compatibility process */
#define TIF_FORK		18	/* ret_from_fork */
#define TIF_NOHZ		19	/* in adaptive nohz mode */
#define TIF_MEMDIE		20	/* is terminating due to OOM killer */
#define TIF_DEBUG		21	/* uses debug registers */
#define TIF_IO_BITMAP		22	/* uses I/O bitmap */
@@ -114,6 +115,7 @@ struct thread_info {
#define _TIF_NOTSC		(1 << TIF_NOTSC)
#define _TIF_IA32		(1 << TIF_IA32)
#define _TIF_FORK		(1 << TIF_FORK)
#define _TIF_NOHZ		(1 << TIF_NOHZ)
#define _TIF_DEBUG		(1 << TIF_DEBUG)
#define _TIF_IO_BITMAP		(1 << TIF_IO_BITMAP)
#define _TIF_FORCED_TF		(1 << TIF_FORCED_TF)
@@ -126,12 +128,13 @@ struct thread_info {
/* work to do in syscall_trace_enter() */
#define _TIF_WORK_SYSCALL_ENTRY	\
	(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU | _TIF_SYSCALL_AUDIT |	\
	 _TIF_SECCOMP | _TIF_SINGLESTEP | _TIF_SYSCALL_TRACEPOINT)
	 _TIF_SECCOMP | _TIF_SINGLESTEP | _TIF_SYSCALL_TRACEPOINT |	\
	 _TIF_NOHZ)

/* work to do in syscall_trace_leave() */
#define _TIF_WORK_SYSCALL_EXIT	\
	(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP |	\
	 _TIF_SYSCALL_TRACEPOINT)
	 _TIF_SYSCALL_TRACEPOINT | _TIF_NOHZ)

/* work to do on interrupt/exception return */
#define _TIF_WORK_MASK							\
@@ -141,7 +144,8 @@ struct thread_info {

/* work to do on any return to user space */
#define _TIF_ALLWORK_MASK						\
	((0x0000FFFF & ~_TIF_SECCOMP) | _TIF_SYSCALL_TRACEPOINT)
	((0x0000FFFF & ~_TIF_SECCOMP) | _TIF_SYSCALL_TRACEPOINT |	\
	_TIF_NOHZ)

/* Only used for 64 bit */
#define _TIF_DO_NOTIFY_MASK						\
Loading