Re: [PATCH -next v4] blk-mq: fix tag_get wait task can't be awakened

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

 



On 12/01/2022 12:30, Andy Shevchenko wrote:
+		if (test_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags) ||
+		    test_and_set_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags)) {
Whoever wrote this code did too much defensive programming, because the first
conditional doesn't make much sense here. Am I right?

I think because this judgement is in the general IO process, there are also
some performance considerations here.
I didn't buy this. Is there any better argument why you need redundant
test_bit() call?


I think that the idea is that test_bit() is fast and test_and_set_bit() is slow; as such, if we generally expect the bit to be set, then there is no need to do the slower test_and_set_bit() always.



[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