On December 22, 2015 10:02:12 AM PST, Mathieu Desnoyers <[email protected]> wrote: >Wire up the thread local ABI on x86 32/64. Call the >thread_local_abi_handle_notify_resume() function on return to >userspace if TIF_NOTIFY_RESUME thread flag is set. > >This provides an ABI improving the speed of a getcpu operation >on x86 by removing the need to perform a function call, "lsl" >instruction, or system call on the fast path. > >Signed-off-by: Mathieu Desnoyers <[email protected]> >CC: Russell King <[email protected]> >CC: Catalin Marinas <[email protected]> >CC: Will Deacon <[email protected]> >CC: Thomas Gleixner <[email protected]> >CC: Paul Turner <[email protected]> >CC: Andrew Hunter <[email protected]> >CC: Peter Zijlstra <[email protected]> >CC: Andy Lutomirski <[email protected]> >CC: Andi Kleen <[email protected]> >CC: Dave Watson <[email protected]> >CC: Chris Lameter <[email protected]> >CC: Ingo Molnar <[email protected]> >CC: Ben Maurer <[email protected]> >CC: Steven Rostedt <[email protected]> >CC: "Paul E. McKenney" <[email protected]> >CC: Josh Triplett <[email protected]> >CC: Linus Torvalds <[email protected]> >CC: Andrew Morton <[email protected]> >CC: Thomas Gleixner <[email protected]> >CC: [email protected] >--- > arch/x86/entry/common.c | 2 ++ > arch/x86/entry/syscalls/syscall_32.tbl | 1 + > arch/x86/entry/syscalls/syscall_64.tbl | 1 + > 3 files changed, 4 insertions(+) > >diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c >index a89fdbc..222cacf 100644 >--- a/arch/x86/entry/common.c >+++ b/arch/x86/entry/common.c >@@ -249,6 +249,8 @@ static void exit_to_usermode_loop(struct pt_regs >*regs, u32 cached_flags) > if (cached_flags & _TIF_NOTIFY_RESUME) { > clear_thread_flag(TIF_NOTIFY_RESUME); > tracehook_notify_resume(regs); >+ if (thread_local_abi_active(current)) >+ thread_local_abi_handle_notify_resume(current);
Every caller seems likely to duplicate this pattern; why not make the call itself a static inline containing this check and call (or no-op if compiled out)? -- To unsubscribe from this list: send the line "unsubscribe linux-api" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
