io_uring: expose single mmap capability
After commit 75b28affdd
we can get by with just a single mmap to
map both the sq and cq ring. However, userspace doesn't know that.
Add a features variable to io_uring_params, and notify userspace
that the kernel has this ability. This can then be used in liburing
(or in applications directly) to avoid the second mmap.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -3391,6 +3391,8 @@ static int io_uring_create(unsigned entries, struct io_uring_params *p)
|
||||
p->cq_off.ring_entries = offsetof(struct io_rings, cq_ring_entries);
|
||||
p->cq_off.overflow = offsetof(struct io_rings, cq_overflow);
|
||||
p->cq_off.cqes = offsetof(struct io_rings, cqes);
|
||||
|
||||
p->features = IORING_FEAT_SINGLE_MMAP;
|
||||
return ret;
|
||||
err:
|
||||
io_ring_ctx_wait_and_kill(ctx);
|
||||
|
Reference in New Issue
Block a user