projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
implement get_cpu_clock() for s390/s390x
[fio.git]
/
memory.c
diff --git
a/memory.c
b/memory.c
index 82a79bd7175b9a74ca0846a669d767e06d50b84d..4a9dc4af212d05feee7b360c9fd6dd08ea6200f4 100644
(file)
--- a/
memory.c
+++ b/
memory.c
@@
-5,7
+5,9
@@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#ifndef FIO_NO_HAVE_SHM_H
#include <sys/shm.h>
#include <sys/shm.h>
+#endif
#include <sys/mman.h>
#include "fio.h"
#include <sys/mman.h>
#include "fio.h"
@@
-121,6
+123,13
@@
static int alloc_mem_mmap(struct thread_data *td, size_t total_mem)
td->mmapfd = 1;
td->mmapfd = 1;
+ if (td->o.mem_type == MEM_MMAPHUGE) {
+ unsigned long mask = td->o.hugepage_size - 1;
+
+ flags |= MAP_HUGETLB;
+ total_mem = (total_mem + mask) & ~mask;
+ }
+
if (td->mmapfile) {
td->mmapfd = open(td->mmapfile, O_RDWR|O_CREAT, 0644);
if (td->mmapfile) {
td->mmapfd = open(td->mmapfile, O_RDWR|O_CREAT, 0644);