summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-10-06 11:01:42 -0600
committerJens Axboe <axboe@kernel.dk>2021-10-19 05:49:56 -0600
commit5ca7a8b3f698b111729ed8e133b14e30f961de0f (patch)
tree978525f96563e546a0154bda07be0bac7a4487cc /fs/io_uring.c
parent88459b50b42a4bd58e528006663afabd0b8652f2 (diff)
io_uring: inform block layer of how many requests we are submitting
The block layer can use this knowledge to make smarter decisions on how to handle the request, if it knows that N more may be coming. Switch to using blk_start_plug_nr_ios() to pass in that information. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index b834cf2778f6..240222da2989 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -317,6 +317,7 @@ struct io_submit_state {
bool plug_started;
bool need_plug;
+ unsigned short submit_nr;
struct blk_plug plug;
};
@@ -7060,7 +7061,7 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
if (state->need_plug && io_op_defs[opcode].plug) {
state->plug_started = true;
state->need_plug = false;
- blk_start_plug(&state->plug);
+ blk_start_plug_nr_ios(&state->plug, state->submit_nr);
}
req->file = io_file_get(ctx, req, READ_ONCE(sqe->fd),
@@ -7181,6 +7182,7 @@ static void io_submit_state_start(struct io_submit_state *state,
{
state->plug_started = false;
state->need_plug = max_ios > 2;
+ state->submit_nr = max_ios;
/* set only head, no need to init link_last in advance */
state->link.head = NULL;
}