lkml.org 
[lkml]   [2020]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] locking/percpu-rwsem: use this_cpu_{inc|dec}() for read_count
On Fri, Sep 18, 2020 at 12:48:24PM +0200, Oleg Nesterov wrote:

> Of course, this assumes that atomic_t->counter underflows "correctly", just
> like "unsigned int".

We're documented that we do. Lots of code relies on that.

See Documentation/atomic_t.txt TYPES

> But again, do we really want this?

I like the two counters better, avoids atomics entirely, some archs
hare horridly expensive atomics (*cough* power *cough*).

I just tried to be clever and use a single u64 load (where possible)
instead of two 32bit loads and got the sum vs split order wrong.

\
 
 \ /
  Last update: 2020-09-18 13:03    [W:0.222 / U:1.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site