td_verror(td, errno, "shmget");
if (geteuid() != 0 && errno == ENOMEM)
log_err("fio: you may need to run this job as root\n");
- if (errno == EINVAL && td->o.mem_type == MEM_SHMHUGE)
- log_err("fio: check that you have free huge pages and that hugepage-size is correct.\n");
+ if (td->o.mem_type == MEM_SHMHUGE) {
+ if (errno == EINVAL)
+ log_err("fio: check that you have free huge pages and that hugepage-size is correct.\n");
+ else if (errno == ENOSYS)
+ log_err("fio: your system does not appear to support huge pages.\n");
+ else if (errno == ENOMEM)
+ log_err("fio: no huge pages available, do you need to alocate some? See HOWTO.\n");
+ }
return 1;
}
static int alloc_mem_malloc(struct thread_data *td)
{
- td->orig_buffer = malloc(td->orig_buffer_size);
+ unsigned int bsize = td->orig_buffer_size;
+
+ if (td->o.odirect)
+ bsize += page_mask;
+
+ td->orig_buffer = malloc(bsize);
if (td->orig_buffer)
return 0;