projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
761bcac
)
io_uring: optimise initial ltimeout refcounting
author
Pavel Begunkov
<asml.silence@gmail.com>
Sun, 15 Aug 2021 09:40:20 +0000
(10:40 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Mon, 23 Aug 2021 19:10:37 +0000
(13:10 -0600)
Linked timeouts are never refcounted when it comes to the first call to
__io_prep_linked_timeout(), so save an io_ref_get() and set the desired
value directly.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link:
https://lore.kernel.org/r/177b24cc62ffbb42d915d6eb9e8876266e4c0d5a.1628981736.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 5b95ab661f3116b1a76d684e3263ff7e4a0c64e6..005fc06f89b9424a679cefe6c80aa390947bc955 100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-1312,8
+1312,7
@@
static struct io_kiocb *__io_prep_linked_timeout(struct io_kiocb *req)
/* linked timeouts should have two refs once prep'ed */
io_req_set_refcount(req);
- io_req_set_refcount(nxt);
- req_ref_get(nxt);
+ __io_req_set_refcount(nxt, 2);
nxt->timeout.head = req;
nxt->flags |= REQ_F_LTIMEOUT_ACTIVE;