Re: [PATCH 1/1] blk-mq: fix race condition in active queue accounting

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

 



On Tue, May 23, 2023 at 09:22:13AM +0100, John Garry wrote:
> On 22/05/2023 22:05, Tian Lan wrote:
> > +		if (test_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags) ||
> > +		    test_and_set_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags))
> 
> We could also add a bitops wrapper function for this. I don't know what name
> to use, maybe test_and_set_bit_fast_but_racy() - I'm half joking about the
> name

I don't think this pattern is any more racy than a solo
test_and_set_bit(). Maybe "test_then_test_and_set_bit()"?



[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