X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;ds=sidebyside;f=memory.c;h=b94cd6df35feed843659bc9bf88921bf55ba9be4;hb=78e51c7279a93d3f6200d58a72a813c3ba852c2e;hp=5285c0a5d416cf2eb40dd5f0698d90927ddf05fb;hpb=a1242a20ac186dccdf8a72e37b9c331e0b4f8a5e;p=fio.git diff --git a/memory.c b/memory.c index 5285c0a5..b94cd6df 100644 --- a/memory.c +++ b/memory.c @@ -76,7 +76,7 @@ static int alloc_mem_shm(struct thread_data *td, unsigned int total_mem) dprint(FD_MEM, "shmget %u, %d\n", total_mem, td->shm_id); if (td->shm_id < 0) { td_verror(td, errno, "shmget"); - if (geteuid() != 0 && errno == ENOMEM) + if (geteuid() != 0 && (errno == ENOMEM || errno == EPERM)) log_err("fio: you may need to run this job as root\n"); if (td->o.mem_type == MEM_SHMHUGE) { if (errno == EINVAL) { @@ -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;