From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Desnoyers Subject: Re: [RFC PATCH v2 2/3] thread_local_abi: wire up x86 32/64 system call Date: Thu, 24 Dec 2015 15:17:17 +0000 (UTC) Message-ID: <713900690.290718.1450970237981.JavaMail.zimbra@efficios.com> References: <1450807333-22104-1-git-send-email-mathieu.desnoyers@efficios.com> <1450807333-22104-2-git-send-email-mathieu.desnoyers@efficios.com> <1ECDFB6F-7C34-4BBB-A45F-E0D9A4B70737@joshtriplett.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1ECDFB6F-7C34-4BBB-A45F-E0D9A4B70737-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Josh Triplett Cc: Paul Turner , Andrew Hunter , Thomas Gleixner , Michael Kerrisk , Russell King , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Catalin Marinas , Will Deacon , Peter Zijlstra , Andy Lutomirski , Andi Kleen , Dave Watson , Chris Lameter , Ingo Molnar , Ben Maurer , rostedt , "Paul E. McKenney" , Linus Torvalds , Andrew Morton , linux-api List-Id: linux-api@vger.kernel.org ----- On Dec 23, 2015, at 10:42 PM, Josh Triplett josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org wrote: > On December 22, 2015 10:02:12 AM PST, Mathieu Desnoyers > 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 >>CC: Russell King >>CC: Catalin Marinas >>CC: Will Deacon >>CC: Thomas Gleixner >>CC: Paul Turner >>CC: Andrew Hunter >>CC: Peter Zijlstra >>CC: Andy Lutomirski >>CC: Andi Kleen >>CC: Dave Watson >>CC: Chris Lameter >>CC: Ingo Molnar >>CC: Ben Maurer >>CC: Steven Rostedt >>CC: "Paul E. McKenney" >>CC: Josh Triplett >>CC: Linus Torvalds >>CC: Andrew Morton >>CC: Thomas Gleixner >>CC: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >>--- >> 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)? Very good point, I'll do that. Thanks! Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com