Re: [PATCH 01/13] seqnum_ops: Introduce Sequence Number Ops

From: Shuah Khan
Date: Wed Nov 11 2020 - 12:34:13 EST


On 11/11/20 9:04 AM, Peter Zijlstra wrote:
On Wed, Nov 11, 2020 at 08:56:49AM -0700, Shuah Khan wrote:

Why would you say no to read and inc?

Because they don't guarantee uniqueness (bar wrapping), which is the
only reason to use an atomic to begin with.


Thanks for the explanation. I see what you are saying.

Not sure what to make of the 6080 atomic_read()s and 3413
atomic_inc()s, some of which might be assuming uniqueness
guarantee.

As far as the sequence number api is concerned, I am with you on
not exposing read() and inc().

inc()s can just map to inc_return().

For read():
In the context of up counters, there is a definitely a need for get
current value type interface that guarantees uniqueness - similar to
inc_return without actually incrementing.

I will work on v2 based on the discussion.

thanks,
-- Shuah