From: Jens Axboe Date: Thu, 17 Feb 2022 17:18:49 +0000 (-0700) Subject: t/io_uring: align buffers correctly on non-4k page sizes X-Git-Tag: fio-3.30~41 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=a0639afe121870a2a9b69cadc07619ba82959e3e;p=fio.git t/io_uring: align buffers correctly on non-4k page sizes Signed-off-by: Jens Axboe --- diff --git a/t/io_uring.c b/t/io_uring.c index 40021647..f513d7dc 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -1156,6 +1156,7 @@ int main(int argc, char *argv[]) struct submitter *s; unsigned long done, calls, reap; int err, i, j, flags, fd, opt, threads_per_f, threads_rem = 0, nfiles; + long page_size; struct file f; char *fdepths; void *ret; @@ -1319,12 +1320,16 @@ int main(int argc, char *argv[]) arm_sig_int(); + page_size = sysconf(_SC_PAGESIZE); + if (page_size < 0) + page_size = 4096; + for (j = 0; j < nthreads; j++) { s = get_submitter(j); for (i = 0; i < roundup_pow2(depth); i++) { void *buf; - if (posix_memalign(&buf, bs, bs)) { + if (posix_memalign(&buf, page_size, bs)) { printf("failed alloc\n"); return 1; }