On Wed, Nov 03, 2021 at 12:32:22PM -0600, Jens Axboe wrote: > + if (plug && !rq_list_empty(plug->cached_rq)) { > + rq = rq_list_peek(&plug->cached_rq); No need for the empty check plus peek. This could be simplified down to: if (!plug) return NULL; rq = rq_list_peek(&plug->cached_rq); if (!rq || rq->q != q) return NULL; rq_qos_throttle(q, bio); plug->cached_rq = rq_list_next(rq); INIT_LIST_HEAD(&rq->queuelist); return rq;