From: Jens Axboe Date: Thu, 28 Oct 2010 14:52:13 +0000 (-0600) Subject: binject: ensure we get aligned memory X-Git-Tag: fio-1.44.2~1 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=ca7e0ddb08fece35c95e9056ca877e0806f1e6ef;ds=sidebyside binject: ensure we get aligned memory Signed-off-by: Jens Axboe --- diff --git a/engines/binject.c b/engines/binject.c index 7109c7ac..47d40fef 100644 --- a/engines/binject.c +++ b/engines/binject.c @@ -416,7 +416,7 @@ static struct ioengine_ops ioengine = { .open_file = fio_binject_open_file, .close_file = fio_binject_close_file, .get_file_size = generic_get_file_size, - .flags = FIO_RAWIO | FIO_BARRIER, + .flags = FIO_RAWIO | FIO_BARRIER | FIO_MEMALIGN, }; #else /* FIO_HAVE_BINJECT */ diff --git a/ioengine.h b/ioengine.h index 7a3c08fd..a0c7e2bc 100644 --- a/ioengine.h +++ b/ioengine.h @@ -128,6 +128,7 @@ enum fio_ioengine_flags { FIO_SIGQUIT = 1 << 7, /* needs SIGQUIT to exit */ FIO_PIPEIO = 1 << 8, /* input/output no seekable */ FIO_BARRIER = 1 << 9, /* engine supports barriers */ + FIO_MEMALIGN = 1 << 10, /* engine wants aligned memory */ }; /* diff --git a/memory.c b/memory.c index 7f4cef52..b94cd6df 100644 --- a/memory.c +++ b/memory.c @@ -193,7 +193,8 @@ int allocate_io_mem(struct thread_data *td) total_mem = td->orig_buffer_size; - if (td->o.odirect || td->o.mem_align) { + if (td->o.odirect || td->o.mem_align || + (td->io_ops->flags & FIO_MEMALIGN)) { total_mem += page_mask; if (td->o.mem_align && td->o.mem_align > page_size) total_mem += td->o.mem_align - page_size;