From 5bb76972f68b81fd99bb97599fe732382bb6da58 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 20 Mar 2007 13:53:39 +0100 Subject: [PATCH] Sometimes we allocated too little memory for buffers Fix it by adding page_mask to the allocation size, then the alignment is guarenteed to fit. Signed-off-by: Jens Axboe --- fio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fio.c b/fio.c index 3c01156d..92cb6573 100644 --- a/fio.c +++ b/fio.c @@ -599,7 +599,7 @@ static int init_io_u(struct thread_data *td) max_units = td->o.iodepth; max_bs = max(td->o.max_bs[DDIR_READ], td->o.max_bs[DDIR_WRITE]); - td->orig_buffer_size = max_bs * max_units; + td->orig_buffer_size = page_mask + (max_bs * max_units); if (td->o.mem_type == MEM_SHMHUGE || td->o.mem_type == MEM_MMAPHUGE) td->orig_buffer_size = (td->orig_buffer_size + td->o.hugepage_size - 1) & ~(td->o.hugepage_size - 1); -- 2.25.1