projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f80a50a
)
io_uring: optimise rw comletion handlers
author
Pavel Begunkov
<asml.silence@gmail.com>
Thu, 14 Oct 2021 15:10:14 +0000
(16:10 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Tue, 19 Oct 2021 11:49:55 +0000
(
05:49
-0600)
Don't override req->result in io_complete_rw_iopoll() when it's already
of the same value, we have an if just above it, so move the assignment
there. Also, add one simle unlikely() in __io_complete_rw_common().
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link:
https://lore.kernel.org/r/8dfeb4f84026a20172bcf82c05010abe955874ae.1634144845.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
patch
|
blob
|
history
diff --git
a/fs/io_uring.c
b/fs/io_uring.c
index 86ef803db27a034876ec6470bb24db7e095088a0..18a91d268fb6bc45246faefbb617374c9e622f10 100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-2640,7
+2640,7
@@
static bool __io_complete_rw_common(struct io_kiocb *req, long res)
{
if (req->rw.kiocb.ki_flags & IOCB_WRITE)
kiocb_end_write(req);
- if (
res != req->result
) {
+ if (
unlikely(res != req->result)
) {
if ((res == -EAGAIN || res == -EOPNOTSUPP) &&
io_rw_should_reissue(req)) {
req->flags |= REQ_F_REISSUE;
@@
-2695,9
+2695,9
@@
static void io_complete_rw_iopoll(struct kiocb *kiocb, long res, long res2)
req->flags |= REQ_F_REISSUE;
return;
}
+ req->result = res;
}
- req->result = res;
/* order with io_iopoll_complete() checking ->iopoll_completed */
smp_store_release(&req->iopoll_completed, 1);
}