On 9/1/20 12:37 PM, Gabriel Krisman Bertazi wrote: > Ming Lei <tom.leiming@xxxxxxxxx> writes: > >> On Mon, Aug 31, 2020 at 11:37 PM Gabriel Krisman Bertazi >> <krisman@xxxxxxxxxxxxx> wrote: > >>> - if (rq->part == mi->part) >>> + if (rq->part == mi->part && rq->state == MQ_RQ_IN_FLIGHT) >>> mi->inflight[rq_data_dir(rq)]++; >> >> The fix looks fine. However, we have helper of >> blk_mq_request_started() for this purpose. > > Thanks for the review. > > I was aware of blk_mq_request_started, but it forces a READ_ONCE which > on Alpha includes a mb() for every tagged request, which doesn't seem > necessary or desired here. I might be wrong though, memory barriers > are hard. :) > > let's see what Jens says about the other points, so I don't spin this > unnecessarily. On the READ_ONCE() part, I don't really care about alpha to the extent that I'll sacrifice readability and code unification to cater to that specific architecture :-) We just need to decide if this makes sense or not. I think we should apply this for 5.10, with Ming's suggestion of using blk_mq_request_started(). Then I guess we'll see what happens... -- Jens Axboe