lkml.org 
[lkml]   [2015]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [RFC PATCH v2 2/3] thread_local_abi: wire up x86 32/64 system call
----- On Dec 23, 2015, at 10:42 PM, Josh Triplett josh@joshtriplett.org wrote:

> On December 22, 2015 10:02:12 AM PST, Mathieu Desnoyers
> <mathieu.desnoyers@efficios.com> 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 <mathieu.desnoyers@efficios.com>
>>CC: Russell King <linux@arm.linux.org.uk>
>>CC: Catalin Marinas <catalin.marinas@arm.com>
>>CC: Will Deacon <will.deacon@arm.com>
>>CC: Thomas Gleixner <tglx@linutronix.de>
>>CC: Paul Turner <pjt@google.com>
>>CC: Andrew Hunter <ahh@google.com>
>>CC: Peter Zijlstra <peterz@infradead.org>
>>CC: Andy Lutomirski <luto@amacapital.net>
>>CC: Andi Kleen <andi@firstfloor.org>
>>CC: Dave Watson <davejwatson@fb.com>
>>CC: Chris Lameter <cl@linux.com>
>>CC: Ingo Molnar <mingo@redhat.com>
>>CC: Ben Maurer <bmaurer@fb.com>
>>CC: Steven Rostedt <rostedt@goodmis.org>
>>CC: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>>CC: Josh Triplett <josh@joshtriplett.org>
>>CC: Linus Torvalds <torvalds@linux-foundation.org>
>>CC: Andrew Morton <akpm@linux-foundation.org>
>>CC: Thomas Gleixner <tglx@linutronix.de>
>>CC: linux-api@vger.kernel.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

\
 
 \ /
  Last update: 2015-12-24 16:41    [W:0.082 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site