On Fri, Mar 17, 2023 at 11:28:13PM +0100, Jan Kara wrote: > > - rq_list_add(&plug->mq_list, rq); > > + last_p = &plug->mq_list; > > + while (*last_p) > > + last_p = &(*last_p)->rq_next; > > + rq_list_add_tail(&last_p, rq); > > plug->rq_count++; > > } > > Uh, I don't think we want to traverse the whole plug list each time we are > adding a request to it. We have just recently managed to avoid that at > least for single-device cases and apparently it was a win for fast devices > (see commit d38a9c04c0d5 ("block: only check previous entry for plug merge > attempt")). REQ_OP_WRITE request for zoned devices are never added to the plug list, so all of this actually is dead (and probably untested?) code. See blk_mq_plug() and bdev_op_is_zoned_write().