From: Jens Axboe Date: Tue, 20 Mar 2007 12:53:39 +0000 (+0100) Subject: Sometimes we allocated too little memory for buffers X-Git-Tag: fio-1.15~65 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=5bb76972f68b81fd99bb97599fe732382bb6da58;p=fio.git 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 --- 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);