On 5/6/21 7:05 PM, Ming Lei wrote: > Putting the lock pair after clearing rq mapping should work, but not see > any benefit: not very readable, and memory barrier knowledge is required for > understanding its correctness(cmpxchg has to be completed before unlock), ..., > so is it better idea to move lock pair after clearing rq mapping? It depends on how much time will be spent inside blk_mq_clear_rq_mapping(). If the time spent in the nested loop in blk_mq_clear_rq_mapping() would be significant then the proposed change will help to reduce interrupt latency in blk_mq_find_and_get_req(). Thanks, Bart.