On Sun, Mar 28, 2021 at 08:49:29PM -0700, Bart Van Assche wrote: > > I don't see a spin_lock_init() on this new lock, though a spinlock seems > > overkill here. If you need an atomic update, you could do: > > > > cmpxchg(&parent->bi_status, 0, bio->bi_status); > > Hmm ... isn't cmpxchg() significantly slower than a spinlock? That is (micro-)architecture-specific, but for common x86 CPU is certainly is going to be at least as fast as the spinlock.