On 4/27/21 8:10 AM, Ming Lei wrote:
+void blk_mq_put_rq_ref(struct request *rq) +{ + if (is_flush_rq(rq, rq->mq_hctx)) + rq->end_io(rq, 0); + else if (refcount_dec_and_test(&rq->ref)) + __blk_mq_free_request(rq); +}
The above function needs more work. blk_mq_put_rq_ref() may be called from multiple CPUs concurrently and hence must handle concurrent calls safely. The flush .end_io callbacks have not been designed to handle concurrent calls.
Bart.