summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-07-20 08:37:31 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-31 07:25:03 +0200
commit19a732f71d46681bb9de5f96a59bc06d55213684 (patch)
tree5cb72d22709bd39e56918d19ac747c72b95631a3 /Makefile
parent4686e134619cf7fc3eaf5edb3da400e3a9a751d2 (diff)
downloadlinux-stable-19a732f71d46681bb9de5f96a59bc06d55213684.tar.gz
linux-stable-19a732f71d46681bb9de5f96a59bc06d55213684.tar.bz2
linux-stable-19a732f71d46681bb9de5f96a59bc06d55213684.zip
io_uring: don't use iov_iter_advance() for fixed buffers
commit bd11b3a391e3df6fa958facbe4b3f9f4cca9bd49 upstream. Hrvoje reports that when a large fixed buffer is registered and IO is being done to the latter pages of said buffer, the IO submission time is much worse: reading to the start of the buffer: 11238 ns reading to the end of the buffer: 1039879 ns In fact, it's worse by two orders of magnitude. The reason for that is how io_uring figures out how to setup the iov_iter. We point the iter at the first bvec, and then use iov_iter_advance() to fast-forward to the offset within that buffer we need. However, that is abysmally slow, as it entails iterating the bvecs that we setup as part of buffer registration. There's really no need to use this generic helper, as we know it's a BVEC type iterator, and we also know that each bvec is PAGE_SIZE in size, apart from possibly the first and last. Hence we can just use a shift on the offset to find the right index, and then adjust the iov_iter appropriately. After this fix, the timings are: reading to the start of the buffer: 10135 ns reading to the end of the buffer: 1377 ns Or about an 755x improvement for the tail page. Reported-by: Hrvoje Zeba <zeba.hrvoje@gmail.com> Tested-by: Hrvoje Zeba <zeba.hrvoje@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions