Commit 99ebe4e
io_uring: pre-initialise some of req fields
Most of requests are allocated from an internal cache, so it's waste of
time fully initialising them every time. Instead, let's pre-init some of
the fields we can during initial allocation (e.g. kmalloc(), see
io_alloc_req()) and keep them valid on request recycling. There are four
of them in this patch:
->ctx is always stays the same
->link is NULL on free, it's an invariant
->result is not even needed to init, just a precaution
->async_data we now clean in io_dismantle_req() as it's likely to
never be allocated.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/892ba0e71309bba9fe9e0142472330bbf9d8f05d.1624739600.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 5182ed2 commit 99ebe4e
1 file changed
Lines changed: 18 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1711 | 1711 | | |
1712 | 1712 | | |
1713 | 1713 | | |
1714 | | - | |
| 1714 | + | |
1715 | 1715 | | |
1716 | 1716 | | |
1717 | 1717 | | |
| |||
1729 | 1729 | | |
1730 | 1730 | | |
1731 | 1731 | | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
1732 | 1746 | | |
1733 | 1747 | | |
1734 | 1748 | | |
| |||
1752 | 1766 | | |
1753 | 1767 | | |
1754 | 1768 | | |
1755 | | - | |
| 1769 | + | |
1756 | 1770 | | |
| 1771 | + | |
| 1772 | + | |
1757 | 1773 | | |
1758 | 1774 | | |
1759 | 1775 | | |
| |||
6534 | 6550 | | |
6535 | 6551 | | |
6536 | 6552 | | |
6537 | | - | |
6538 | 6553 | | |
6539 | | - | |
6540 | | - | |
6541 | 6554 | | |
6542 | 6555 | | |
6543 | 6556 | | |
6544 | 6557 | | |
6545 | | - | |
6546 | 6558 | | |
6547 | 6559 | | |
6548 | 6560 | | |
| |||
0 commit comments