X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;ds=inline;f=init.c;h=edaec144f3aaaa5895339df4f2a703bdff7d9c48;hb=d0bdaf49eb3f4faa941d02274f2bd875a187e7d7;hp=0c888b8fcdca83a0bdc7691d2eb38202393ebcbb;hpb=e0a223354342cc45a916b669343718b80a20c2ea;p=fio.git diff --git a/init.c b/init.c index 0c888b8f..edaec144 100644 --- a/init.c +++ b/init.c @@ -833,6 +833,29 @@ static int str_mem_cb(void *data, const char *mem) if (!strncmp(mem, "malloc", 6)) { td->mem_type = MEM_MALLOC; return 0; + } else if (!strncmp(mem, "mmaphuge", 8)) { +#ifdef FIO_HAVE_HUGETLB + char *hugefile; + + /* + * mmaphuge must be appended with the actual file + */ + hugefile = strstr(mem, ":"); + if (!hugefile) { + log_err("fio: mmaphuge:/path/to/file\n"); + return 1; + } + + hugefile++; + strip_blank_front(&hugefile); + strip_blank_end(hugefile); + td->hugefile = strdup(hugefile); + td->mem_type = MEM_MMAPHUGE; + return 0; +#else + log_err("fio: mmaphuge not available\n"); + return 1; +#endif } else if (!strncmp(mem, "mmap", 4)) { td->mem_type = MEM_MMAP; return 0; @@ -849,7 +872,7 @@ static int str_mem_cb(void *data, const char *mem) return 0; } - log_err("fio: mem type: malloc, shm, mmap, shmhuge\n"); + log_err("fio: mem type: malloc, shm, shmhuge, mmap, mmaphuge\n"); return 1; }