Commit c5ac744c authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'io_uring-6.11-20240824' of git://git.kernel.dk/linux

Pull io_uring fixes from Jens Axboe:

 - Fix a comment in the uapi header using the wrong member name (Caleb)

 - Fix KCSAN warning for a debug check in sqpoll (me)

 - Two more NAPI tweaks (Olivier)

* tag 'io_uring-6.11-20240824' of git://git.kernel.dk/linux:
  io_uring: fix user_data field name in comment
  io_uring/sqpoll: annotate debug task == current with data_race()
  io_uring/napi: remove duplicate io_napi_entry timeout assignation
  io_uring/napi: check napi_enabled in io_napi_add() before proceeding
parents 2731835f 1fc2ac42
...@@ -421,7 +421,7 @@ enum io_uring_msg_ring_flags { ...@@ -421,7 +421,7 @@ enum io_uring_msg_ring_flags {
* IO completion data structure (Completion Queue Entry) * IO completion data structure (Completion Queue Entry)
*/ */
struct io_uring_cqe { struct io_uring_cqe {
__u64 user_data; /* sqe->data submission passed back */ __u64 user_data; /* sqe->user_data value passed back */
__s32 res; /* result code for this event */ __s32 res; /* result code for this event */
__u32 flags; __u32 flags;
......
...@@ -26,7 +26,6 @@ static struct io_napi_entry *io_napi_hash_find(struct hlist_head *hash_list, ...@@ -26,7 +26,6 @@ static struct io_napi_entry *io_napi_hash_find(struct hlist_head *hash_list,
hlist_for_each_entry_rcu(e, hash_list, node) { hlist_for_each_entry_rcu(e, hash_list, node) {
if (e->napi_id != napi_id) if (e->napi_id != napi_id)
continue; continue;
e->timeout = jiffies + NAPI_TIMEOUT;
return e; return e;
} }
...@@ -302,7 +301,7 @@ void __io_napi_busy_loop(struct io_ring_ctx *ctx, struct io_wait_queue *iowq) ...@@ -302,7 +301,7 @@ void __io_napi_busy_loop(struct io_ring_ctx *ctx, struct io_wait_queue *iowq)
{ {
iowq->napi_prefer_busy_poll = READ_ONCE(ctx->napi_prefer_busy_poll); iowq->napi_prefer_busy_poll = READ_ONCE(ctx->napi_prefer_busy_poll);
if (!(ctx->flags & IORING_SETUP_SQPOLL) && ctx->napi_enabled) if (!(ctx->flags & IORING_SETUP_SQPOLL))
io_napi_blocking_busy_loop(ctx, iowq); io_napi_blocking_busy_loop(ctx, iowq);
} }
......
...@@ -55,7 +55,7 @@ static inline void io_napi_add(struct io_kiocb *req) ...@@ -55,7 +55,7 @@ static inline void io_napi_add(struct io_kiocb *req)
struct io_ring_ctx *ctx = req->ctx; struct io_ring_ctx *ctx = req->ctx;
struct socket *sock; struct socket *sock;
if (!READ_ONCE(ctx->napi_busy_poll_dt)) if (!READ_ONCE(ctx->napi_enabled))
return; return;
sock = sock_from_file(req->file); sock = sock_from_file(req->file);
......
...@@ -44,7 +44,7 @@ void io_sq_thread_unpark(struct io_sq_data *sqd) ...@@ -44,7 +44,7 @@ void io_sq_thread_unpark(struct io_sq_data *sqd)
void io_sq_thread_park(struct io_sq_data *sqd) void io_sq_thread_park(struct io_sq_data *sqd)
__acquires(&sqd->lock) __acquires(&sqd->lock)
{ {
WARN_ON_ONCE(sqd->thread == current); WARN_ON_ONCE(data_race(sqd->thread) == current);
atomic_inc(&sqd->park_pending); atomic_inc(&sqd->park_pending);
set_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state); set_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment