Re: [PATCH v2] blk-mq: Fix a race condition in blk_mq_mark_tag_wait()

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

 



On Wed, Jun 27, 2018 at 01:02:12PM -0700, Bart Van Assche wrote:
> Because the hctx lock is not held around the only
> blk_mq_tag_wakeup_all() call in the block layer, the wait queue
> entry removal in blk_mq_dispatch_wake() is protected by the wait
> queue lock only. Since the hctx->dispatch_wait entry can occur on
> any of the SBQ_WAIT_QUEUES, the wait queue presence check, adding
> .dispatch_wait to a wait queue and removing the wait queue entry
> must all be protected by both the hctx lock and the wait queue
> lock.

Actually we don't need to use hctx->lock for protecting
hctx->dispatch_wait, and one new lock of hctx->dispatch_wait_lock is
enough, please see the following patch:

	https://marc.info/?l=linux-block&m=152998658713265&w=2

Then we can avoid to disable irq when acquiring hctx->lock.


Thanks,
Ming



[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