summaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-07-19 10:00:05 +0200
committerJens Axboe <jens.axboe@oracle.com>2007-07-19 10:00:05 +0200
commitd8602dd08170e11fb91dccde945bc527dbba57aa (patch)
tree3feca76be15cecb5bfa1026b4b15776ff85dcf8e /memory.c
parent6b3eccb158d1f4cebc2924fc6abf84c1bf59d002 (diff)
downloadfio-d8602dd08170e11fb91dccde945bc527dbba57aa.tar.gz
fio-d8602dd08170e11fb91dccde945bc527dbba57aa.tar.bz2
Detect and print when the OS doesn't support huge pages
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/memory.c b/memory.c
index d075c352..a95edd78 100644
--- a/memory.c
+++ b/memory.c
@@ -65,8 +65,12 @@ static int alloc_mem_shm(struct thread_data *td)
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_SHMHUM) {
+ 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");
+ }
return 1;
}