Jens Axboe
46b1b3d81a
io_uring/kbuf: use vm_insert_pages() for mmap'ed pbuf ring
...
Commit 87585b05757dc70545efb434669708d276125559 upstream.
Rather than use remap_pfn_range() for this and manually free later,
switch to using vm_insert_page() and have it Just Work.
This requires a bit of effort on the mmap lookup side, as the ctx
uring_lock isn't held, which otherwise protects buffer_lists from being
torn down, and it's not safe to grab from mmap context that would
introduce an ABBA deadlock between the mmap lock and the ctx uring_lock.
Instead, lookup the buffer_list under RCU, as the the list is RCU freed
already. Use the existing reference count to determine whether it's
possible to safely grab a reference to it (eg if it's not zero already),
and drop that reference when done with the mapping. If the mmap
reference is the last one, the buffer_list and the associated memory can
go away, since the vma insertion has references to the inserted pages at
that point.
Signed-off-by: Jens Axboe <axboe@kernel.dk >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2025-03-22 12:50:45 -07:00
..
2024-12-09 10:32:02 +01:00
2025-01-02 10:31:59 +01:00
2024-12-19 18:11:29 +01:00
2024-10-22 15:46:19 +02:00
2024-12-14 19:59:46 +01:00
2024-10-22 15:46:35 +02:00
2025-02-08 09:51:57 +01:00
2025-02-17 09:40:08 +01:00
2024-12-14 20:00:00 +01:00
2025-02-08 09:51:54 +01:00
2024-09-12 11:11:32 +02:00
2025-02-21 13:57:17 +01:00
2024-09-08 07:54:43 +02:00
2025-03-07 16:45:36 +01:00
2025-02-08 09:52:37 +01:00
2024-09-12 11:11:40 +02:00
2024-11-14 13:19:38 +01:00
2025-02-17 09:40:03 +01:00
2024-10-04 16:29:59 +02:00
2025-02-21 13:57:09 +01:00
2024-12-09 10:32:56 +01:00
2025-01-09 13:32:06 +01:00
2024-09-12 11:11:34 +02:00
2024-12-19 18:11:25 +01:00
2025-02-08 09:52:26 +01:00
2025-02-21 13:57:17 +01:00
2025-01-09 13:31:53 +01:00
2025-03-13 12:58:27 +01:00
2024-12-09 10:32:46 +01:00
2024-12-09 10:32:46 +01:00
2024-11-08 16:28:20 +01:00
2024-12-19 18:11:36 +01:00
2024-10-10 11:57:58 +02:00
2024-08-29 17:33:14 +02:00
2024-11-22 15:38:35 +01:00
2024-11-08 16:28:24 +01:00
2024-09-04 13:28:24 +02:00
2024-12-14 20:00:16 +01:00
2025-02-21 13:57:17 +01:00
2024-12-14 19:59:58 +01:00
2024-08-29 17:33:31 +02:00
2024-10-04 16:29:37 +02:00
2024-12-14 20:00:05 +01:00
2024-10-10 11:58:00 +02:00
2025-03-22 12:50:44 -07:00
2024-09-08 07:54:44 +02:00
2024-12-14 19:59:45 +01:00
2025-02-08 09:51:56 +01:00
2024-12-09 10:31:48 +01:00
2025-01-23 17:21:17 +01:00
2024-11-08 16:28:27 +01:00
2025-03-13 12:58:38 +01:00
2024-09-08 07:54:43 +02:00
2024-12-27 13:58:54 +01:00
2024-10-10 11:58:01 +02:00
2025-03-22 12:50:37 -07:00
2025-02-08 09:51:58 +01:00
2025-01-09 13:32:02 +01:00
2024-12-09 10:32:59 +01:00
2024-10-17 15:24:26 +02:00
2025-03-22 12:50:45 -07:00
2024-12-27 13:58:55 +01:00
2024-11-08 16:28:19 +01:00
2024-10-17 15:24:13 +02:00
2024-12-09 10:31:50 +01:00
2025-02-08 09:52:27 +01:00
2025-02-17 09:40:16 +01:00
2024-12-14 20:00:12 +01:00
2024-12-09 10:32:45 +01:00
2025-01-09 13:31:40 +01:00
2024-11-01 01:58:25 +01:00
2024-10-17 15:24:10 +02:00
2025-01-17 13:36:26 +01:00
2025-01-17 13:36:26 +01:00
2024-11-22 15:38:37 +01:00
2024-12-09 10:32:59 +01:00
2025-02-08 09:52:02 +01:00
2025-01-09 13:31:41 +01:00
2025-02-27 04:10:49 -08:00
2024-10-17 15:24:29 +02:00
2024-12-09 10:32:12 +01:00
2024-10-17 15:24:23 +02:00
2025-01-17 13:36:09 +01:00
2025-03-22 12:50:43 -07:00
2024-09-18 19:24:04 +02:00
2025-02-27 04:10:47 -08:00
2024-12-09 10:31:56 +01:00
2025-02-08 09:51:51 +01:00
2024-12-09 10:32:59 +01:00
2024-12-09 10:32:59 +01:00
2024-10-17 15:24:22 +02:00
2024-12-14 20:00:14 +01:00
2025-02-08 09:51:44 +01:00
2024-09-12 11:11:40 +02:00
2025-01-23 17:21:14 +01:00
2025-02-08 09:52:38 +01:00
2024-09-18 19:24:03 +02:00
2025-01-23 17:21:12 +01:00
2024-12-09 10:32:59 +01:00
2025-03-07 16:45:47 +01:00
2025-01-09 13:31:41 +01:00
2024-10-04 16:29:38 +02:00
2024-12-14 19:59:50 +01:00
2025-03-13 12:58:27 +01:00
2025-02-01 18:37:51 +01:00
2025-01-09 13:32:05 +01:00
2024-12-09 10:31:51 +01:00
2025-02-27 04:10:45 -08:00
2025-02-27 04:10:50 -08:00
2024-08-29 17:33:23 +02:00
2024-12-09 10:32:10 +01:00
2024-11-22 15:38:32 +01:00
2025-01-09 13:31:41 +01:00
2024-12-19 18:11:37 +01:00
2024-10-10 11:58:08 +02:00
2024-11-01 01:58:20 +01:00
2024-10-17 15:24:23 +02:00
2024-11-08 16:28:16 +01:00
2024-11-14 13:19:37 +01:00
2025-01-09 13:31:55 +01:00
2025-01-09 13:31:55 +01:00
2024-11-08 16:28:26 +01:00
2024-10-10 11:57:36 +02:00
2024-11-14 13:19:39 +01:00
2024-12-09 10:33:06 +01:00
2024-10-10 11:57:17 +02:00
2025-01-02 10:32:00 +01:00
2024-12-27 13:58:57 +01:00
2024-10-04 16:30:02 +02:00