diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-09-02 14:31:51 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-09-02 14:31:51 +0200 |
| commit | 864c971e923f55d3ff5ac3ebc87aab8108d30c8a (patch) | |
| tree | 3fd77c646490ad640a4cb7f37c63a1eaf8c2bd7b /io_uring/futex.c | |
| parent | 19ccd439d0087525b48dfcc8e584a0a940230744 (diff) | |
| parent | 1c732c6b94f0faee1526bd375add2fe10cba2e26 (diff) | |
Merge v6.18.49linux-rolling-lts
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring/futex.c')
| -rw-r--r-- | io_uring/futex.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/io_uring/futex.c b/io_uring/futex.c index 57a17c694221..3e92c2a63960 100644 --- a/io_uring/futex.c +++ b/io_uring/futex.c @@ -149,14 +149,16 @@ int io_futex_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) int io_futex_wait_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) { + struct io_futex *iof = io_kiocb_to_cmd(req, struct io_futex); int ret; ret = io_futex_prep(req, sqe); if (unlikely(ret)) return ret; - /* Mark as inflight, so file exit cancelation will find it */ - io_req_track_inflight(req); + /* inflight tracking only needed for mm private hash */ + if (!(iof->futex_flags & FLAGS_SHARED)) + io_req_track_inflight(req); return 0; } @@ -172,13 +174,14 @@ static void io_futex_wakev_fn(struct wake_q_head *wake_q, struct futex_q *q) io_req_set_res(req, 0, 0); req->io_task_work.func = io_futexv_complete; - io_req_task_work_add(req); + __io_req_task_work_add(req, IOU_F_TWQ_IN_WAKE); } int io_futexv_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) { struct io_futex *iof = io_kiocb_to_cmd(req, struct io_futex); struct futex_vector *futexv; + unsigned int i; int ret; /* No flags or mask supported for waitv */ @@ -202,8 +205,14 @@ int io_futexv_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) return ret; } - /* Mark as inflight, so file exit cancelation will find it */ - io_req_track_inflight(req); + /* inflight tracking only needed for mm private hash */ + for (i = 0; i < iof->futex_nr; i++) { + if (!(futexv[i].w.flags & FLAGS_SHARED)) { + io_req_track_inflight(req); + break; + } + } + iof->futexv_owned = 0; iof->futexv_unqueued = 0; req->flags |= REQ_F_ASYNC_DATA; @@ -221,7 +230,7 @@ static void io_futex_wake_fn(struct wake_q_head *wake_q, struct futex_q *q) io_req_set_res(req, 0, 0); req->io_task_work.func = io_futex_complete; - io_req_task_work_add(req); + __io_req_task_work_add(req, IOU_F_TWQ_IN_WAKE); } int io_futexv_wait(struct io_kiocb *req, unsigned int issue_flags) |
