io_uring: get rid of remap_pfn_range() for mapping rings/sqes
authorJens Axboe <axboe@kernel.dk>
Wed, 13 Mar 2024 15:56:14 +0000 (09:56 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 29 Mar 2024 15:34:41 +0000 (09:34 -0600)
commitf615ee268021bc2ce30aea62fa4f8d7216b0d3c4
tree58599648c521e1db528897d747ac78575497f76a
parent04dbfcd7ef6bac09971b89905de3a8ece42e65d4
io_uring: get rid of remap_pfn_range() for mapping rings/sqes

Rather than use remap_pfn_range() for this and manually free later,
switch to using vm_insert_pages() and have it Just Work.

If possible, allocate a single compound page that covers the range that
is needed. If that works, then we can just use page_address() on that
page. If we fail to get a compound page, allocate single pages and use
vmap() to map them into the kernel virtual address space.

This just covers the rings/sqes, the other remaining user of the mmap
remap_pfn_range() user will be converted separately. Once that is done,
we can kill the old alloc/free code.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c
io_uring/io_uring.h