projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reduntant write bit checks
[fio.git]
/
memory.c
diff --git
a/memory.c
b/memory.c
index be664c9c22a40285cd07c6f7f69da120408618d7..b5a71d5397fd852d42e2fb73f4d45b2a90d38e3b 100644
(file)
--- a/
memory.c
+++ b/
memory.c
@@
-6,7
+6,6
@@
#include <sys/mman.h>
#include "fio.h"
#include <sys/mman.h>
#include "fio.h"
-#include "os.h"
static void *pinned_mem;
static void *pinned_mem;
@@
-72,6
+71,8
@@
int allocate_io_mem(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");
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");
return 1;
}
return 1;
}
@@
-96,6
+97,11
@@
int allocate_io_mem(struct thread_data *td)
td->orig_buffer = NULL;
return 1;
}
td->orig_buffer = NULL;
return 1;
}
+ if (ftruncate(td->mmapfd, td->orig_buffer_size) < 0) {
+ td_verror(td, errno, "truncate mmap file");
+ td->orig_buffer = NULL;
+ return 1;
+ }
} else
flags |= OS_MAP_ANON;
} else
flags |= OS_MAP_ANON;