summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Roesch <shr@fb.com>2022-04-25 11:26:35 -0700
committerJens Axboe <axboe@kernel.dk>2022-05-16 09:30:57 -0600
commit7eb8df1b627cce6ccb1ce1b422a713a06943eb6e (patch)
tree528751319d914896bbdeb179b8536daa61d8a3ea
parent5fa7867d8c5b027a421c72dfc68c7c4ac186dbb9 (diff)
downloadliburing-7eb8df1b627cce6ccb1ce1b422a713a06943eb6e.tar.gz
liburing-7eb8df1b627cce6ccb1ce1b422a713a06943eb6e.tar.bz2
liburing: increase mmap size for large CQE's
This doubles the mmap size for large CQE's. Signed-off-by: Stefan Roesch <shr@fb.com> Link: https://lore.kernel.org/r/20220425182639.2446370-3-shr@fb.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/setup.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/setup.c b/src/setup.c
index aec8b33..dd6a712 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -21,8 +21,12 @@ static int io_uring_mmap(int fd, struct io_uring_params *p,
size_t size;
int ret;
+ size = sizeof(struct io_uring_cqe);
+ if (p->flags & IORING_SETUP_CQE32)
+ size += sizeof(struct io_uring_cqe);
+
sq->ring_sz = p->sq_off.array + p->sq_entries * sizeof(unsigned);
- cq->ring_sz = p->cq_off.cqes + p->cq_entries * sizeof(struct io_uring_cqe);
+ cq->ring_sz = p->cq_off.cqes + p->cq_entries * size;
if (p->features & IORING_FEAT_SINGLE_MMAP) {
if (cq->ring_sz > sq->ring_sz)