Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756023AbcDDRDQ (ORCPT ); Mon, 4 Apr 2016 13:03:16 -0400 Received: from mail.efficios.com ([78.47.125.74]:38562 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753575AbcDDRDN convert rfc822-to-8bit (ORCPT ); Mon, 4 Apr 2016 13:03:13 -0400 From: Mathieu Desnoyers To: Andrew Morton , Russell King , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, 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 Subject: [RFC PATCH v6 0/5] Thread-local ABI system call (CPU number cache) Date: Mon, 4 Apr 2016 13:01:48 -0400 Message-Id: <1459789313-4917-1-git-send-email-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2143 Lines: 55 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