lkml.org 
[lkml]   [2019]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 14/16] locking/rwsem: Guard against making count negative
On Fri, Apr 19, 2019 at 03:03:04PM +0200, Peter Zijlstra wrote:
> On Fri, Apr 19, 2019 at 02:02:07PM +0200, Peter Zijlstra wrote:
> > On Fri, Apr 19, 2019 at 12:26:47PM +0200, Peter Zijlstra wrote:
> > > I thought of a horrible horrible alternative:
> >
> > Hurm, that's broken as heck. Let me try again.
>
> So I can't make that scheme work, it all ends up wanting to have
> cmpxchg().
>
> Do we have a performance comparison somewhere of xadd vs cmpxchg
> readers? I tried looking in the old threads, but I can't seem to locate
> it.
>
> We need new instructions :/ Or more clever than I can muster just now.

In particular, an (unsigned) saturation arithmetic variant of XADD would
be very nice to have at this point.

\
 
 \ /
  Last update: 2019-04-19 21:32    [W:0.103 / U:3.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site