From: Frederic Weisbecker <fweis...@gmail.com> Add syscall hooks to notify syscall entry and exit on CPUs running in adative nohz mode.
Signed-off-by: Frederic Weisbecker <fweis...@gmail.com> Cc: Alessio Igor Bogani <abog...@kernel.org> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Avi Kivity <a...@redhat.com> Cc: Chris Metcalf <cmetc...@tilera.com> Cc: Christoph Lameter <c...@linux.com> Cc: Daniel Lezcano <daniel.lezc...@linaro.org> Cc: Geoff Levand <ge...@infradead.org> Cc: Gilad Ben Yossef <gi...@benyossef.com> Cc: Hakan Akkan <hakanak...@gmail.com> Cc: Ingo Molnar <mi...@kernel.org> Cc: Kevin Hilman <khil...@ti.com> Cc: Max Krasnyansky <m...@qualcomm.com> Cc: Paul E. McKenney <paul...@linux.vnet.ibm.com> Cc: Peter Zijlstra <pet...@infradead.org> Cc: Stephen Hemminger <shemmin...@vyatta.com> Cc: Steven Rostedt <rost...@goodmis.org> Cc: Sven-Thorsten Dietrich <thebigcorporat...@gmail.com> Cc: Thomas Gleixner <t...@linutronix.de> Signed-off-by: Steven Rostedt <rost...@goodmis.org> --- arch/x86/kernel/ptrace.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index b00b33a..9c18e1e 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c @@ -22,6 +22,7 @@ #include <linux/perf_event.h> #include <linux/hw_breakpoint.h> #include <linux/rcupdate.h> +#include <linux/tick.h> #include <asm/uaccess.h> #include <asm/pgtable.h> @@ -1461,6 +1462,10 @@ long syscall_trace_enter(struct pt_regs *regs) { long ret = 0; + /* Notify nohz task syscall early so the rest can use rcu */ + /* (SDR: Does the rcu_user_exit() make this obsolete?) */ + tick_nohz_enter_kernel(); + rcu_user_exit(); /* @@ -1528,4 +1533,10 @@ void syscall_trace_leave(struct pt_regs *regs) tracehook_report_syscall_exit(regs, step); rcu_user_enter(); + /* + * Notify nohz task exit syscall at last so the rest can + * use rcu. + * (SDR: does the above make this obsolete?) + */ + tick_nohz_exit_kernel(); } -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/