locking/osq: Use cpu number for 'next' pointer

There is only one write done through node->next (setting prev) when 'node' is
being removed. So the code can consistently use the cpu numbers pretty much
throughout (this was suggested by Linus a while back).

This reduces struct optimistic_spin_node to 8 bytes. This is currently padded
out to a cache line which is silly. Change to be __aligned(8) so that it isn't
split between cache lines.

Accesses to 'other cpu' data are very limited and only happen during the
enqueue and dequeue operation.

[peterz: complete rewrite]
Signed-off-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260907084133.3696-7-david.laight.linux@gmail.com
1 file changed