Re: [PATCH v4 1/5] getcpu_cache system call: cache CPU number of running thread
From: Peter Zijlstra
Date: Mon Feb 29 2016 - 05:35:17 EST
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.