We default to 4MiB, but export the setting so it can be changed.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
divide that number by the huge page size. You can see the
size of the huge pages in /proc/meminfo. If no huge pages
are allocated by having a non-zero number in nr_hugepages,
- using mmaphuge or shmhuge will fail.
+ using mmaphuge or shmhuge will fail. Also see hugepage-size.
mmaphuge also needs to have hugetlbfs mounted and the file
location should point there. So if it's mounted in /huge,
you would use mem=mmaphuge:/huge/somefile.
+hugepage-size=siint
+ Defines the size of a huge page. Must at least be equal
+ to the system setting, see /proc/meminfo. Defaults to 4MiB.
+
exitall When one job finishes, terminate the rest. The default is
to wait for each job to finish, sometimes that is not the
desired action.
td->orig_buffer_size = max_bs * max_units;
if (td->mem_type == MEM_SHMHUGE || td->mem_type == MEM_MMAPHUGE)
- td->orig_buffer_size = (td->orig_buffer_size + FIO_HUGE_PAGE - 1) & ~(FIO_HUGE_PAGE - 1);
+ td->orig_buffer_size = (td->orig_buffer_size + td->hugepage_size - 1) & ~(td->hugepage_size - 1);
else
td->orig_buffer_size += MASK;
unsigned int bs[2];
unsigned int min_bs[2];
unsigned int max_bs[2];
+ unsigned int hugepage_size;
unsigned int rw_min_bs;
unsigned int thinktime;
unsigned int fsync_blocks;
#define DEF_WRITE_BW_LOG (0)
#define DEF_WRITE_LAT_LOG (0)
#define DEF_NO_RAND_MAP (0)
+#define DEF_HUGEPAGE_SIZE FIO_HUGE_PAGE
#define td_var_offset(var) ((size_t) &((struct thread_data *)0)->var)
.type = FIO_OPT_STR_SET,
.off1 = td_var_offset(bs_unaligned),
},
+ {
+ .name = "hugepage-size",
+ .type = FIO_OPT_STR_VAL,
+ .off1 = td_var_offset(hugepage_size),
+ },
{
.name = NULL,
},
def_thread.write_bw_log = write_bw_log;
def_thread.write_lat_log = write_lat_log;
def_thread.norandommap = DEF_NO_RAND_MAP;
+ def_thread.hugepage_size = DEF_HUGEPAGE_SIZE;
#ifdef FIO_HAVE_DISK_UTIL
def_thread.do_disk_util = 1;
#endif