linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v6 0/5] Thread-local ABI system call (CPU number cache)
@ 2016-04-04 17:01 Mathieu Desnoyers
  2016-04-04 17:01 ` [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number of running thread Mathieu Desnoyers
                   ` (4 more replies)
  0 siblings, 5 replies; 29+ messages in thread
From: Mathieu Desnoyers @ 2016-04-04 17:01 UTC (permalink / raw)
  To: Andrew Morton, Russell King, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin
  Cc: linux-kernel, linux-api, Paul Turner, Andrew Hunter,
	Peter Zijlstra, Andy Lutomirski, Andi Kleen, Dave Watson,
	Chris Lameter, Ben Maurer, Steven Rostedt, Paul E. McKenney,
	Josh Triplett, Linus Torvalds, Catalin Marinas, Will Deacon,
	Michael Kerrisk, Boqun Feng, Mathieu Desnoyers

Hi,

This patchset implements a general ABI to exchange per-thread data
between kernel and user-space. The initial feature implemented is a
cache for the CPU number of the currently running thread in user-space.
This ABI is extensible to add more features in the future.

Benchmarks comparing this approach to a getcpu based on system call on
ARM show a 44x speedup. They show a 16.5x speedup on x86-64 compared to
executing lsl from a vDSO through glibc.

There is a man page in the changelog of patch 1/5, which shows an
example usage of this new system call.

This patchset is sent as RFC. It applies on Linux 4.5. The prior
versions of this patchset were known as a "getcpu_cache system call".

Feedback is welcome,

Thanks!

Mathieu


Mathieu Desnoyers (5):
  Thread-local ABI system call: cache CPU number of running thread
  Thread-local ABI cpu_id: ARM resume notifier
  Thread-local ABI: wire up ARM system call
  Thread-local ABI cpu_id: x86 32/64 resume notifier
  Thread-local ABI: wire up x86 32/64 system call

 MAINTAINERS                            |   7 +++
 arch/arm/include/asm/unistd.h          |   2 +-
 arch/arm/include/uapi/asm/unistd.h     |   1 +
 arch/arm/kernel/calls.S                |   3 +-
 arch/arm/kernel/signal.c               |   1 +
 arch/x86/entry/common.c                |   1 +
 arch/x86/entry/syscalls/syscall_32.tbl |   1 +
 arch/x86/entry/syscalls/syscall_64.tbl |   1 +
 fs/exec.c                              |   1 +
 include/linux/sched.h                  |  66 +++++++++++++++++++++
 include/uapi/linux/Kbuild              |   1 +
 include/uapi/linux/thread_local_abi.h  |  83 ++++++++++++++++++++++++++
 init/Kconfig                           |  14 +++++
 kernel/Makefile                        |   1 +
 kernel/fork.c                          |   4 ++
 kernel/sched/sched.h                   |   1 +
 kernel/sys_ni.c                        |   3 +
 kernel/thread_local_abi.c              | 103 +++++++++++++++++++++++++++++++++
 18 files changed, 292 insertions(+), 2 deletions(-)
 create mode 100644 include/uapi/linux/thread_local_abi.h
 create mode 100644 kernel/thread_local_abi.c

-- 
2.1.4

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2016-04-07 20:55 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-04 17:01 [RFC PATCH v6 0/5] Thread-local ABI system call (CPU number cache) Mathieu Desnoyers
2016-04-04 17:01 ` [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number of running thread Mathieu Desnoyers
2016-04-04 17:11   ` H. Peter Anvin
2016-04-04 19:46     ` Mathieu Desnoyers
2016-04-04 20:48       ` Mathieu Desnoyers
2016-04-05 16:02         ` Florian Weimer
2016-04-05 16:47           ` Peter Zijlstra
2016-04-07  9:01             ` Florian Weimer
2016-04-07 10:31               ` Peter Zijlstra
2016-04-07 10:39                 ` Florian Weimer
2016-04-07 11:19                   ` Peter Zijlstra
2016-04-07 12:03                     ` Florian Weimer
2016-04-07 12:25                       ` Peter Zijlstra
2016-04-07 12:37                         ` Florian Weimer
2016-04-07 15:59                         ` Mathieu Desnoyers
2016-04-07 12:34                       ` Mathieu Desnoyers
2016-04-07 16:39                     ` Linus Torvalds
2016-04-07 16:46                       ` Andy Lutomirski
2016-04-07 16:50                       ` Florian Weimer
2016-04-07 16:59                         ` Linus Torvalds
2016-04-07 16:52                       ` Linus Torvalds
2016-04-07 18:43                         ` Mathieu Desnoyers
2016-04-07 20:22                           ` Andi Kleen
2016-04-07 20:55                             ` Mathieu Desnoyers
2016-04-07 10:40   ` Florian Weimer
2016-04-04 17:01 ` [RFC PATCH v6 2/5] Thread-local ABI cpu_id: ARM resume notifier Mathieu Desnoyers
2016-04-04 17:01 ` [RFC PATCH v6 3/5] Thread-local ABI: wire up ARM system call Mathieu Desnoyers
2016-04-04 17:01 ` [RFC PATCH v6 4/5] Thread-local ABI cpu_id: x86 32/64 resume notifier Mathieu Desnoyers
2016-04-04 17:01 ` [RFC PATCH v6 5/5] Thread-local ABI: wire up x86 32/64 system call Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).