Commit 95ed0c5
blk-mq: optimise blk_mq_flush_plug_list()
Instead of using list_del_init() in a loop, that generates a lot of
unnecessary memory read/writes, iterate from the first request of a
batch and cut out a sublist with list_cut_before().
Apart from removing the list node initialisation part, this is more
register-friendly, and the assembly uses the stack less intensively.
list_empty() at the beginning is done with hope, that the compiler can
optimise out the same check in the following list_splice_init().
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 28ca0d6 commit 95ed0c5
1 file changed
Lines changed: 19 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1678 | 1678 | | |
1679 | 1679 | | |
1680 | 1680 | | |
1681 | | - | |
1682 | | - | |
1683 | | - | |
1684 | | - | |
1685 | 1681 | | |
1686 | | - | |
1687 | | - | |
1688 | 1682 | | |
| 1683 | + | |
| 1684 | + | |
1689 | 1685 | | |
1690 | 1686 | | |
1691 | 1687 | | |
1692 | 1688 | | |
1693 | 1689 | | |
1694 | 1690 | | |
1695 | 1691 | | |
1696 | | - | |
1697 | | - | |
1698 | | - | |
1699 | | - | |
1700 | | - | |
1701 | | - | |
1702 | | - | |
1703 | | - | |
1704 | | - | |
1705 | | - | |
1706 | | - | |
1707 | | - | |
1708 | | - | |
1709 | | - | |
1710 | | - | |
1711 | | - | |
1712 | | - | |
1713 | | - | |
1714 | | - | |
1715 | | - | |
1716 | | - | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
1717 | 1706 | | |
1718 | 1707 | | |
1719 | | - | |
1720 | | - | |
1721 | | - | |
1722 | | - | |
1723 | | - | |
1724 | | - | |
1725 | | - | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
| 1708 | + | |
| 1709 | + | |
1729 | 1710 | | |
1730 | 1711 | | |
1731 | | - | |
| 1712 | + | |
1732 | 1713 | | |
1733 | 1714 | | |
1734 | 1715 | | |
| |||
0 commit comments