diff options
| author | Pavel Begunkov <asml.silence@gmail.com> | 2024-11-29 13:34:36 +0000 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2024-12-23 08:17:16 -0700 |
| commit | 78fda3d056417ccb9921663383b12f771aa0dd43 (patch) | |
| tree | b0ce495a29357ac062730cfb0426d15beec39eaf /io_uring/kbuf.h | |
| parent | 81a4058e0cd0f07139f088fbeb65bc488f687829 (diff) | |
| download | lwn-78fda3d056417ccb9921663383b12f771aa0dd43.tar.gz lwn-78fda3d056417ccb9921663383b12f771aa0dd43.zip | |
io_uring/kbuf: use mmap_lock to sync with mmap
A preparation / cleanup patch simplifying the buf ring - mmap
synchronisation. Instead of relying on RCU, which is trickier, do it by
grabbing the mmap_lock when when anyone tries to publish or remove a
registered buffer to / from ->io_bl_xa.
Modifications of the xarray should always be protected by both
->uring_lock and ->mmap_lock, while lookups should hold either of them.
While a struct io_buffer_list is in the xarray, the mmap related fields
like ->flags and ->buf_pages should stay stable.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/af13bde56ee1a26bcaefaa9aad37a9ea318a590e.1732886067.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/kbuf.h')
| -rw-r--r-- | io_uring/kbuf.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/io_uring/kbuf.h b/io_uring/kbuf.h index 36aadfe5ac00..d5e4afcbfbb3 100644 --- a/io_uring/kbuf.h +++ b/io_uring/kbuf.h @@ -25,7 +25,6 @@ struct io_buffer_list { struct page **buf_pages; struct io_uring_buf_ring *buf_ring; }; - struct rcu_head rcu; }; __u16 bgid; |
