From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753559AbcB2KfN (ORCPT ); Mon, 29 Feb 2016 05:35:13 -0500 Received: from casper.infradead.org ([85.118.1.10]:55539 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752026AbcB2KfK (ORCPT ); Mon, 29 Feb 2016 05:35:10 -0500 Date: Mon, 29 Feb 2016 11:35:06 +0100 From: Peter Zijlstra To: Mathieu Desnoyers 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 , "H. Peter Anvin" Subject: Re: [PATCH v4 1/5] getcpu_cache system call: cache CPU number of running thread Message-ID: <20160229103506.GJ6356@twins.programming.kicks-ass.net> References: <1456270120-7560-1-git-send-email-mathieu.desnoyers@efficios.com> <2053850250.10158.1456582501604.JavaMail.zimbra@efficios.com> <20160227145809.GD6356@twins.programming.kicks-ass.net> <1401667361.10273.1456617236327.JavaMail.zimbra@efficios.com> <1082926946.10326.1456619994590.JavaMail.zimbra@efficios.com> <1538518747.10504.1456669948568.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1538518747.10504.1456669948568.JavaMail.zimbra@efficios.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 28, 2016 at 02:32:28PM +0000, Mathieu Desnoyers wrote: > The part of ABI I'm trying to express here is for discoverability > of available features by user-space. For instance, a kernel > could be configured with "CONFIG_RSEQ=n", and userspace should > not rely on the rseq fields of the thread-local ABI in that case. Per the just proposed interface; discoverability would end with: thread_local_abi_register(NULL, TLA_ENABLE_RSEQ, 0); failing. This would indicate your kernel does not support (or your glibc failed to register, depending on error code I suppose). Then your program can either fall back to full atomics or just bail.