Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/futex: move futexv owned status to struct io_futexv_data

Free up a bit of space in the shared futex opcode private data, by
moving the futexv specific futexv_owned out of there and into the struct
specific to vectored futexes.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

+7 -9
+7 -9
io_uring/futex.c
··· 17 17 void __user *uaddr; 18 18 unsigned long futex_val; 19 19 unsigned long futex_mask; 20 - unsigned long futexv_owned; 21 20 u32 futex_flags; 22 21 unsigned int futex_nr; 23 22 bool futexv_unqueued; ··· 28 29 }; 29 30 30 31 struct io_futexv_data { 32 + unsigned long owned; 31 33 struct futex_vector futexv[]; 32 34 }; 33 35 ··· 82 82 __io_futex_complete(tw_req, tw); 83 83 } 84 84 85 - static bool io_futexv_claim(struct io_futex *iof) 85 + static bool io_futexv_claim(struct io_futexv_data *ifd) 86 86 { 87 - if (test_bit(0, &iof->futexv_owned) || 88 - test_and_set_bit_lock(0, &iof->futexv_owned)) 87 + if (test_bit(0, &ifd->owned) || test_and_set_bit_lock(0, &ifd->owned)) 89 88 return false; 90 89 return true; 91 90 } ··· 99 100 return false; 100 101 req->io_task_work.func = io_futex_complete; 101 102 } else { 102 - struct io_futex *iof = io_kiocb_to_cmd(req, struct io_futex); 103 + struct io_futexv_data *ifd = req->async_data; 103 104 104 - if (!io_futexv_claim(iof)) 105 + if (!io_futexv_claim(ifd)) 105 106 return false; 106 107 req->io_task_work.func = io_futexv_complete; 107 108 } ··· 157 158 static void io_futex_wakev_fn(struct wake_q_head *wake_q, struct futex_q *q) 158 159 { 159 160 struct io_kiocb *req = q->wake_data; 160 - struct io_futex *iof = io_kiocb_to_cmd(req, struct io_futex); 161 + struct io_futexv_data *ifd = req->async_data; 161 162 162 - if (!io_futexv_claim(iof)) 163 + if (!io_futexv_claim(ifd)) 163 164 return; 164 165 if (unlikely(!__futex_wake_mark(q))) 165 166 return; ··· 199 200 200 201 /* Mark as inflight, so file exit cancelation will find it */ 201 202 io_req_track_inflight(req); 202 - iof->futexv_owned = 0; 203 203 iof->futexv_unqueued = 0; 204 204 req->flags |= REQ_F_ASYNC_DATA; 205 205 req->async_data = ifd;