lkml.org 
[lkml]   [2020]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] locking/refcount: Provide __refcount API to obtain the old value
On Wed, Jul 29, 2020 at 09:41:37PM +0100, David Howells wrote:
> peterz@infradead.org wrote:
>
> > I'm not entirely sure what you mean with interpret, provided you don't
> > trigger a refcount fail, the number will be just what you expect and
> > would get from refcount_read(). If you do trigger a fail, you'll get a
> > negative value.
>
> That's fine. I seem to remember talk about the possibility that the number
> wouldn't necessarily bottom out at zero - for instance if it was arranged such
> that the overflow flag was set on an overflow or underflow so that it could be
> trapped on (using INTO or TRAPV, for example).

The trap is an internal detail. The saturation value will be negative,
though.

--
Kees Cook

\
 
 \ /
  Last update: 2020-07-29 22:54    [W:0.102 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site