summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-08-09 13:04:10 +0100
committerJens Axboe <axboe@kernel.dk>2021-08-23 13:07:59 -0600
commit282cdc86937bd31cf0ea49978ad7a42cfe12ea35 (patch)
tree6ba9c939123c9779e3cb79f805003f3cae935f95 /fs/io_uring.c
parenta2416e1ec23c6b79010d03d69c0e4e035339b4ad (diff)
downloadlwn-282cdc86937bd31cf0ea49978ad7a42cfe12ea35.tar.gz
lwn-282cdc86937bd31cf0ea49978ad7a42cfe12ea35.zip
io_uring: add more locking annotations for submit
Add more annotations for submission path functions holding ->uring_lock. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/128ec4185e26fbd661dd3a424aa66108ee8ff951.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 6a3079a038fb..ff17c4e9aa42 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2133,6 +2133,7 @@ static void io_req_free_batch(struct req_batch *rb, struct io_kiocb *req,
}
static void io_submit_flush_completions(struct io_ring_ctx *ctx)
+ __must_hold(&req->ctx->uring_lock)
{
struct io_comp_state *cs = &ctx->submit_state.comp;
int i, nr = cs->nr;
@@ -6473,6 +6474,7 @@ static struct io_kiocb *io_prep_linked_timeout(struct io_kiocb *req)
}
static void __io_queue_sqe(struct io_kiocb *req)
+ __must_hold(&req->ctx->uring_lock)
{
struct io_kiocb *linked_timeout = io_prep_linked_timeout(req);
int ret;
@@ -6516,6 +6518,7 @@ issue_sqe:
}
static inline void io_queue_sqe(struct io_kiocb *req)
+ __must_hold(&req->ctx->uring_lock)
{
if (unlikely(req->ctx->drain_active) && io_drain_req(req))
return;
@@ -6560,6 +6563,7 @@ static inline bool io_check_restriction(struct io_ring_ctx *ctx,
static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
const struct io_uring_sqe *sqe)
+ __must_hold(&ctx->uring_lock)
{
struct io_submit_state *state;
unsigned int sqe_flags;
@@ -6623,6 +6627,7 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
static int io_submit_sqe(struct io_ring_ctx *ctx, struct io_kiocb *req,
const struct io_uring_sqe *sqe)
+ __must_hold(&ctx->uring_lock)
{
struct io_submit_link *link = &ctx->submit_state.link;
int ret;
@@ -6755,6 +6760,7 @@ static const struct io_uring_sqe *io_get_sqe(struct io_ring_ctx *ctx)
}
static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr)
+ __must_hold(&ctx->uring_lock)
{
struct io_uring_task *tctx;
int submitted = 0;