diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2012-11-27 13:33:25 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-11-30 14:40:07 -0500 |
commit | 91d1aa43d30505b0b825db8898ffc80a8eca96c7 (patch) | |
tree | 911636f846d800c8a44efd540842dc726ec7c191 /arch/x86/kernel | |
parent | 4e79752c25ec221ac1e28f8875b539ed7631a0db (diff) |
context_tracking: New context tracking susbsystem
Create a new subsystem that probes on kernel boundaries
to keep track of the transitions between level contexts
with two basic initial contexts: user or kernel.
This is an abstraction of some RCU code that use such tracking
to implement its userspace extended quiescent state.
We need to pull this up from RCU into this new level of indirection
because this tracking is also going to be used to implement an "on
demand" generic virtual cputime accounting. A necessary step to
shutdown the tick while still accounting the cputime.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Gilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
[ paulmck: fix whitespace error and email address. ]
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/entry_64.S | 2 | ||||
-rw-r--r-- | arch/x86/kernel/ptrace.c | 8 | ||||
-rw-r--r-- | arch/x86/kernel/signal.c | 5 | ||||
-rw-r--r-- | arch/x86/kernel/traps.c | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 0c58952d64e8..98faeb30139d 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -56,7 +56,7 @@ | |||
56 | #include <asm/ftrace.h> | 56 | #include <asm/ftrace.h> |
57 | #include <asm/percpu.h> | 57 | #include <asm/percpu.h> |
58 | #include <asm/asm.h> | 58 | #include <asm/asm.h> |
59 | #include <asm/rcu.h> | 59 | #include <asm/context_tracking.h> |
60 | #include <asm/smap.h> | 60 | #include <asm/smap.h> |
61 | #include <linux/err.h> | 61 | #include <linux/err.h> |
62 | 62 | ||
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index eff5b8c68652..65b88a5dc1a8 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/signal.h> | 21 | #include <linux/signal.h> |
22 | #include <linux/perf_event.h> | 22 | #include <linux/perf_event.h> |
23 | #include <linux/hw_breakpoint.h> | 23 | #include <linux/hw_breakpoint.h> |
24 | #include <linux/rcupdate.h> | 24 | #include <linux/context_tracking.h> |
25 | 25 | ||
26 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> |
27 | #include <asm/pgtable.h> | 27 | #include <asm/pgtable.h> |
@@ -1461,7 +1461,7 @@ long syscall_trace_enter(struct pt_regs *regs) | |||
1461 | { | 1461 | { |
1462 | long ret = 0; | 1462 | long ret = 0; |
1463 | 1463 | ||
1464 | rcu_user_exit(); | 1464 | user_exit(); |
1465 | 1465 | ||
1466 | /* | 1466 | /* |
1467 | * If we stepped into a sysenter/syscall insn, it trapped in | 1467 | * If we stepped into a sysenter/syscall insn, it trapped in |
@@ -1516,7 +1516,7 @@ void syscall_trace_leave(struct pt_regs *regs) | |||
1516 | * or do_notify_resume(), in which case we can be in RCU | 1516 | * or do_notify_resume(), in which case we can be in RCU |
1517 | * user mode. | 1517 | * user mode. |
1518 | */ | 1518 | */ |
1519 | rcu_user_exit(); | 1519 | user_exit(); |
1520 | 1520 | ||
1521 | audit_syscall_exit(regs); | 1521 | audit_syscall_exit(regs); |
1522 | 1522 | ||
@@ -1534,5 +1534,5 @@ void syscall_trace_leave(struct pt_regs *regs) | |||
1534 | if (step || test_thread_flag(TIF_SYSCALL_TRACE)) | 1534 | if (step || test_thread_flag(TIF_SYSCALL_TRACE)) |
1535 | tracehook_report_syscall_exit(regs, step); | 1535 | tracehook_report_syscall_exit(regs, step); |
1536 | 1536 | ||
1537 | rcu_user_enter(); | 1537 | user_enter(); |
1538 | } | 1538 | } |
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index 29ad351804e9..20ecac112e74 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/uaccess.h> | 22 | #include <linux/uaccess.h> |
23 | #include <linux/user-return-notifier.h> | 23 | #include <linux/user-return-notifier.h> |
24 | #include <linux/uprobes.h> | 24 | #include <linux/uprobes.h> |
25 | #include <linux/context_tracking.h> | ||
25 | 26 | ||
26 | #include <asm/processor.h> | 27 | #include <asm/processor.h> |
27 | #include <asm/ucontext.h> | 28 | #include <asm/ucontext.h> |
@@ -816,7 +817,7 @@ static void do_signal(struct pt_regs *regs) | |||
816 | void | 817 | void |
817 | do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags) | 818 | do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags) |
818 | { | 819 | { |
819 | rcu_user_exit(); | 820 | user_exit(); |
820 | 821 | ||
821 | #ifdef CONFIG_X86_MCE | 822 | #ifdef CONFIG_X86_MCE |
822 | /* notify userspace of pending MCEs */ | 823 | /* notify userspace of pending MCEs */ |
@@ -840,7 +841,7 @@ do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags) | |||
840 | if (thread_info_flags & _TIF_USER_RETURN_NOTIFY) | 841 | if (thread_info_flags & _TIF_USER_RETURN_NOTIFY) |
841 | fire_user_return_notifiers(); | 842 | fire_user_return_notifiers(); |
842 | 843 | ||
843 | rcu_user_enter(); | 844 | user_enter(); |
844 | } | 845 | } |
845 | 846 | ||
846 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where) | 847 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where) |
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 8276dc6794cc..eb8586693e0b 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
@@ -55,7 +55,7 @@ | |||
55 | #include <asm/i387.h> | 55 | #include <asm/i387.h> |
56 | #include <asm/fpu-internal.h> | 56 | #include <asm/fpu-internal.h> |
57 | #include <asm/mce.h> | 57 | #include <asm/mce.h> |
58 | #include <asm/rcu.h> | 58 | #include <asm/context_tracking.h> |
59 | 59 | ||
60 | #include <asm/mach_traps.h> | 60 | #include <asm/mach_traps.h> |
61 | 61 | ||