Thread (36 messages) 36 messages, 4 authors, 2017-08-05

Re: [PATCH 05/14] blk-mq-sched: don't dequeue request until all in ->dispatch are flushed

From: Bart Van Assche <hidden>
Date: 2017-08-01 16:14:07
Also in: linux-scsi

On Tue, 2017-08-01 at 18:44 +0800, Ming Lei wrote:
On Mon, Jul 31, 2017 at 11:42:21PM +0000, Bart Van Assche wrote:
quoted
Since setting, clearing and testing of BLK_MQ_S_BUSY can happen concurr=
ently
quoted
and since clearing and testing happens without any locks held I'm afrai=
d this
quoted
patch introduces the following race conditions:
[ ... ]
* Checking BLK_MQ_S_BUSY after requests have been removed from the disp=
atch list
quoted
  but before that bit is cleared, resulting in test_bit(BLK_MQ_S_BUSY, =
&hctx->state)
quoted
  reporting that the BLK_MQ_S_BUSY
has been set although there are no requests
  on the dispatch list.
=20
That won't be a problem, because dispatch will be started in the
context in which dispatch list is flushed, since the BUSY bit
is cleared after blk_mq_dispatch_rq_list() returns. So no I/O
hang.
Hello Ming,

Please consider changing the name of the BLK_MQ_S_BUSY constant. That bit
is used to serialize dispatching requests from the hctx dispatch list but
that's not clear from the name of that constant.

Thanks,

Bart.=
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help