[PATCH 2/3] io_uring: move trace_submit_sqe into submit_sqe

From: Pavel Begunkov
Date: Tue Dec 17 2019 - 14:27:48 EST


For better locality, call trace_io_uring_submit_sqe() from submit_sqe()
rather than io_submit_sqes(). No functional change.

Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
---
fs/io_uring.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index e8ce224dc82c..ee461bcd3121 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3375,7 +3375,8 @@ static bool io_submit_sqe(struct io_kiocb *req, struct io_submit_state *state,
struct io_ring_ctx *ctx = req->ctx;
int ret;

- req->user_data = req->sqe->user_data;
+ req->user_data = READ_ONCE(req->sqe->user_data);
+ trace_io_uring_submit_sqe(ctx, req->user_data, true, req->in_async);

/* enforce forwards compatibility on users */
if (unlikely(req->sqe->flags & ~SQE_VALID_FLAGS)) {
@@ -3569,8 +3570,6 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr,
req->has_user = *mm != NULL;
req->in_async = async;
req->needs_fixed_file = async;
- trace_io_uring_submit_sqe(ctx, req->sqe->user_data,
- true, async);
if (!io_submit_sqe(req, statep, &link))
break;
/*
--
2.24.0