On 6/22/23 22:50, Christoph Hellwig wrote:
+ blk_mq_process_requeue_list(hctx);
Should this do list_empty_careful checks on ->requeue_list and
->flush_list so that we can avoid taking the requeue lock when
these conditions aren't met before calling into
blk_mq_process_requeue_list?
Hi Christoph,
I agree that checks whether or not requeue_list and flush_list are empty
should be added.
Does it matter in this context whether list_empty_careful() or
list_empty() is used? If blk_mq_process_requeue_list() is called
concurrently with code that adds an element to one of these two lists it
is guaranteed that the queue will be run again. This is why I think that
it is fine that the list checks in blk_mq_process_requeue_list() race
with concurrent list additions.
Thanks,
Bart.