From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753011AbcCAVvH (ORCPT ); Tue, 1 Mar 2016 16:51:07 -0500 Received: from torg.zytor.com ([198.137.202.12]:48120 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751349AbcCAVvF (ORCPT ); Tue, 1 Mar 2016 16:51:05 -0500 Subject: Re: [PATCH v4 1/5] getcpu_cache system call: cache CPU number of running thread To: Peter Zijlstra , Mathieu Desnoyers References: <1456270120-7560-1-git-send-email-mathieu.desnoyers@efficios.com> <1401667361.10273.1456617236327.JavaMail.zimbra@efficios.com> <1082926946.10326.1456619994590.JavaMail.zimbra@efficios.com> <1538518747.10504.1456669948568.JavaMail.zimbra@efficios.com> <20160229103506.GJ6356@twins.programming.kicks-ass.net> <676569856.13488.1456863792603.JavaMail.zimbra@efficios.com> <20160301213202.GY6357@twins.programming.kicks-ass.net> Cc: Linus Torvalds , Ben Maurer , Thomas Gleixner , Ingo Molnar , Russell King , linux-api , Andrew Morton , Michael Kerrisk , Dave Watson , rostedt , Andy Lutomirski , Will Deacon , "Paul E. McKenney" , Chris Lameter , Andi Kleen , Josh Triplett , Paul Turner , Linux Kernel Mailing List , Catalin Marinas , Andrew Hunter From: "H. Peter Anvin" Message-ID: <56D60DFA.4040809@zytor.com> Date: Tue, 1 Mar 2016 13:47:38 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160301213202.GY6357@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/01/16 13:32, Peter Zijlstra wrote: > On Tue, Mar 01, 2016 at 08:23:12PM +0000, Mathieu Desnoyers wrote: >> I think it's important that user-space fast-paths can quickly >> detect whether the feature is enabled without having to rely on >> always reading a separate cache-line. I've put together an ABI >> proposal that take into account the feedback received so far. > > Nah, adding detectoring code to fast paths is silly, makes them less > fast. Doesn't userspace have self modifying code? I know that at least > glibc does linker trickery to call different functions depending on > runtime context. > No, userspace does not have self-modifying code. The glibc indirect function is done at dynamic link time; it is also worth noting that resolving global symbols through dynamic linking often requires an indirect call. -hpa