Support for mapping SQ/CQ rings into huge page
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest4 patches 2 repliesIn review
- v1 RFC4 patches 0 repliesSuperseded
Changes in v2 from the cover letter
- Mandate that we're using a single page. May be a normal page if we don't need a lot of memory, or a huge page if the ring itself takes up more space than a single normal page.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | io_uring: remove sq/cq_off memsetio_uring/ | +4 | 0 replies | |
| 2/4 | io_uring: return error pointer from io_mem_alloc()io_uring/ | +12 | 2 replies | |
| 3/4 | io_uring: add ring freeing helperio_uring/ | +11 | 0 replies | |
| 4/4 | io_uring: support for user allocated memory for rings/sqesinclude/ include/ io_uring/ | +115 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCHSET 0/4 v2] Support for mapping SQ/CQ rings into huge page
Hi,
io_uring SQ/CQ rings are allocated by the kernel from contigious, normal pages, and then the application mmap()'s the rings into userspace. This works fine, but does require contigious pages to be available for the given SQ and CQ ring sizes. As uptime increases on a given system, so does memory fragmentation. Entropy is invevitable.
This patchset adds support for the application passing in a pre-allocated huge page, and then placing the rings in that. This reduces the need for contigious pages, and also reduces the TLB pressure for larger rings.
The liburing huge.2 branch has support for using this trivially. Applications may use the normal ring init helpers and set IORING_SETUP_NO_MMAP, in which case a huge page will get allocated for them and used. Or they may use io_uring_queue_init_mem() and pass in a pre-allocated huge page, getting the amount of it used returned. This allows placing multiple rings into a single huge page.
Changes since v1:
- Mandate that we're using a single page. May be a normal page if we don't need a lot of memory, or a huge page if the ring itself takes up more space than a single normal page.
Signature · 1 line
Jens Axboe