Commit 7f212e9
virtio_blk: reverse request order in virtio_queue_rqs
blk_mq_flush_plug_list submits requests in the reverse order that they
were submitted, which leads to a rather suboptimal I/O pattern
especially in rotational devices. Fix this by rewriting virtio_queue_rqs
so that it always pops the requests from the passed in request list, and
then adds them to the head of a local submit list. This actually
simplifies the code a bit as it removes the complicated list splicing,
at the cost of extra updates of the rq_next pointer. As that should be
cache hot anyway it should be an easy price to pay.
Fixes: 0e9911f ("virtio-blk: support mq_ops->queue_rqs()")
Signed-off-by: Christoph Hellwig <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>1 parent beadf00 commit 7f212e9
1 file changed
+21
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
474 | | - | |
| 474 | + | |
475 | 475 | | |
476 | 476 | | |
| 477 | + | |
477 | 478 | | |
478 | | - | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
483 | | - | |
484 | | - | |
| 483 | + | |
485 | 484 | | |
| 485 | + | |
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
| |||
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
498 | | - | |
| 498 | + | |
| 499 | + | |
499 | 500 | | |
500 | 501 | | |
501 | 502 | | |
502 | 503 | | |
503 | | - | |
| 504 | + | |
504 | 505 | | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
505 | 509 | | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
| 510 | + | |
| 511 | + | |
516 | 512 | | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
522 | 516 | | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
527 | 521 | | |
528 | 522 | | |
| 523 | + | |
| 524 | + | |
529 | 525 | | |
530 | 526 | | |
531 | 527 | | |
| |||
0 commit comments