Re: [RFC PATCH] block: protect bi_status with spinlock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux