summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorStefan Roesch <shr@fb.com>2022-06-16 14:22:19 -0700
committerJens Axboe <axboe@kernel.dk>2022-07-24 18:39:32 -0600
commit1c849b481b3e4f8c36f297cd3aa88ef52a19cee9 (patch)
tree9a9e425148c5837aa780ac99d4f10d4cb72caba4 /io_uring
parente053aaf4da56cbf0afb33a0fda4a62188e2c0637 (diff)
io_uring: Add tracepoint for short writes
This adds the io_uring_short_write tracepoint to io_uring. A short write is issued if not all pages that are required for a write are in the page cache and the async buffered writes have to return EAGAIN. Signed-off-by: Stefan Roesch <shr@fb.com> Link: https://lore.kernel.org/r/20220616212221.2024518-13-shr@fb.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/rw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/io_uring/rw.c b/io_uring/rw.c
index 1f4a8ff98254..2b784795103c 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -933,6 +933,9 @@ int io_write(struct io_kiocb *req, unsigned int issue_flags)
if (ret2 != req->cqe.res && ret2 >= 0 && need_complete_io(req)) {
struct io_async_rw *rw;
+ trace_io_uring_short_write(req->ctx, kiocb->ki_pos - ret2,
+ req->cqe.res, ret2);
+
/* This is a partial write. The file pos has already been
* updated, setup the async struct to complete the request
* in the worker. Also update bytes_done to account for