lkml.org 
[lkml]   [2016]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/5] getcpu_cache system call: cache CPU number of running thread
On Tue, Mar 01, 2016 at 10:32:02PM +0100, Peter Zijlstra wrote:

> > /*
> > * Thread-local ABI rseq_seqnum field.
> > * Updated by the kernel, and read by user-space with
> > * single-copy atomicity semantics. Aligned on 32-bit.
> > * Values:
> > * >= 0: current seqnum for this thread (feature is active).
> > * -1 (initial value): means the rseq feature is inactive.
> > * -2: rseq feature is not available.
> > */
> > int32_t rseq_seqnum;
>
> So I really hate that, that makes we have to check for these special
> values whenever we increment the seq count and cannot have it wrap
> naturally.

Also, since it will wrap, uint32_t is more natural, since the whole
signed overflow thing is somewhat undefined in C.

\
 
 \ /
  Last update: 2016-03-01 23:01    [W:0.083 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site