io_uring: Use submit info inlined into req
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 6 Nov 2019 22:41:07 +0000 (01:41 +0300)
committerJens Axboe <axboe@kernel.dk>
Thu, 7 Nov 2019 03:23:00 +0000 (20:23 -0700)
commit50585b9a07367b92382c1e975265344daeba78cd
tree8be101bb9e1d1657394340b5e61dfe0a6be66c4c
parent196be95cd5572078be9deb81cbea145fab246029
io_uring: Use submit info inlined into req

Stack allocated struct sqe_submit is passed down to the submission path
along with a request (a.k.a. struct io_kiocb), and will be copied into
req->submit for async requests.

As space for it is already allocated, fill req->submit in the first
place instead of using on-stack one. As a result:

1. sqe->submit is the only place for sqe_submit and is always valid,
so we don't need to track which one to use.
2. don't need to copy in case of async
3. allows to simplify the code by not carrying it as an argument all
the way down
4. allows to reduce number of function arguments / potentially improve
spilling

The downside is that stack is most probably be cached, that's not true
for just allocated memory for a request. Another concern is cache
pollution. Though, a request would be touched and fetched along with
req->submit at some point anyway, so shouldn't be a problem.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c