Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751649AbbEZVUq (ORCPT ); Tue, 26 May 2015 17:20:46 -0400 Received: from one.firstfloor.org ([193.170.194.197]:53001 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751320AbbEZVUo (ORCPT ); Tue, 26 May 2015 17:20:44 -0400 Date: Tue, 26 May 2015 23:20:41 +0200 From: Andi Kleen To: Andy Lutomirski Cc: Mathieu Desnoyers , "H. Peter Anvin" , Andi Kleen , Borislav Petkov , Lai Jiangshan , "Paul E. McKenney" , Ben Maurer , Josh Triplett , Ingo Molnar , Andrew Morton , Linux API , Michael Kerrisk , Linux Kernel , Linus Torvalds , Peter Zijlstra , Paul Turner , Steven Rostedt , Andrew Hunter Subject: Re: [RFC PATCH] percpu system call: fast userspace percpu critical sections Message-ID: <20150526212041.GQ19417@two.firstfloor.org> References: <1432219487-13364-1-git-send-email-mathieu.desnoyers@efficios.com> <757752240.6470.1432330487312.JavaMail.zimbra@efficios.com> <1839774559.6579.1432400944032.JavaMail.zimbra@efficios.com> <1184354091.7499.1432578613872.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1589 Lines: 39 I haven't thought too much about it, but doing it in a vdso seems reasonable. It would mean that the scheduler hot path would need to know about its address though. > > You appear to summarize the two things that are added to the kernel with > > this RFC patch: > > - faster getcpu(): 12.7 ns -> 0.3 ns > > Yeah, I figured that out the second time I read your email and re-read > the original message, but I apparently forgot to fix up the email I > was typing. The high speed users seem to have all switched to using LSL directly, which is even faster. Since there are already users it cannot be changed anymore. Should probably just document this as an official ABI, and provide some standard include file with inline code. > IIRC some other OS's use gs as a userspace per-cpu pointer instead of > a per-thread pointer. Would we want to consider enabling that? > This may interact oddly with the WIP wrgsbase stuff. (Grr, Intel, why > couldn't you have made wrgsbase reset the gs selector to zero? That > would have been so much nicer.) Applications really want the extra address registers. For example OpenJDK could free a GPR. And it's needed for the TLS of user space threads, which are becoming more and more popular. So there are already more important users queued. -Andi -- ak@linux.intel.com -- Speaking for myself only. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/