Thread (8 messages) flat view 8 messages, 4 authors, 2016-03-02

Re: [PATCH v4 1/5] getcpu_cache system call: cache CPU number of running thread

From: Peter Zijlstra <peterz@infradead.org>
Date: 2016-03-02 10:34:17
Also in: lkml

On Tue, Mar 01, 2016 at 01:47:38PM -0800, H. Peter Anvin wrote:
On 03/01/16 13:32, Peter Zijlstra wrote:
quoted
On Tue, Mar 01, 2016 at 08:23:12PM +0000, Mathieu Desnoyers wrote:
quoted
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.
Boy that blows. And here I was thinking you could edit the code at
dynamic link time because nobody was running it yet :/

And I suppose JITs need an (effective) munmap()+mmap() cycle to ensure
the 'old' code is flushed from all caches etc..?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help