On Tue, 8 Oct 2024 at 03:12, Christian Brauner <brauner@xxxxxxxxxx> wrote: > > Switching atomic_long_fetch_inc() would change the logic quite a bit > though as atomic_long_fetch_inc() returns the previous value. You can use atomic_long_inc_return() if you want the new value. So the "atomic_fetch_op()" is a "fetch old value and do the op". The "atomic_op_return()" is "do the op and return the new value". We do have both, although on x86, the "fetch_op" is the one that most closely then maps to "xadd". But if you find the current code easier, that's fine. Linus