On 12/14/2017 12:13 AM, Tejun Heo wrote:
> Hello,
>
> On Wed, Dec 13, 2017 at 11:30:48AM +0800, jianchao.wang wrote:
>>> + } else {
>>> + srcu_idx = srcu_read_lock(hctx->queue_rq_srcu);
>>> + if (!blk_mark_rq_complete(rq))
>>> + __blk_mq_complete_request(rq);
>>> + srcu_read_unlock(hctx->queue_rq_srcu, srcu_idx);
>>
>> The __blk_mq_complete_request() could be executed in irq context. There
>> should not be any
>> sleeping operations in it. If just synchronize with the timeout path to
>> ensure the aborted_gstate
>> to be seen, only rcu is needed here ,as well as the blk_mq_timeout_work.
>
> Sure, but it's just a lot cleaner to use the same to protect both
> issue and completion; otherwise, whoever who wants to synchronize
> against them have to do awkward double rcu locking.
>
It's fair. Thanks for your detailed response. That's really appreciated.
> Thanks.
>
- Re: [PATCH 2/6] blk-mq: replace timeout s... Peter Zijlstra
- Re: [PATCH 2/6] blk-mq: replace time... jianchao.wang
- Re: [PATCH 2/6] blk-mq: replace ... Peter Zijlstra
- Re: [PATCH 2/6] blk-mq: replace ... jianchao.wang
- Re: [PATCH 2/6] blk-mq: replace time... Mike Galbraith
- Re: [PATCH 2/6] blk-mq: replace timeout synch... [email protected]
- [PATCH 3/6] blk-mq: use blk_mq_rq_state() instead of testi... Tejun Heo
- [PATCH 1/6] blk-mq: protect completion path with RCU Tejun Heo
- Re: [PATCH 1/6] blk-mq: protect completion path with ... jianchao.wang
- Re: [PATCH 1/6] blk-mq: protect completion path w... Tejun Heo
- Re: [PATCH 1/6] blk-mq: protect completion pa... jianchao.wang
- Re: [PATCH 1/6] blk-mq: protect completion path with ... Bart Van Assche
- Re: [PATCHSET v2] blk-mq: reimplement timeout handling Jens Axboe
- Re: [PATCHSET v2] blk-mq: reimplement timeout handling Bart Van Assche
