The softrandommap job option allows fio to continue if it cannot
allocate from the smalloc backing for the random map. Or the user
can specify --alloc-size with a size larger than the default of 1024k
to increase the size of the shared allocation pool.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio doesn't track potential block rewrites which may alter
the calculated checksum for that block.
fio doesn't track potential block rewrites which may alter
the calculated checksum for that block.
+softrandommap See norandommap. If fio runs with the random block map enabled
+ and it fails to allocate the map, if this option is set it
+ will continue without a random block map. As coverage will
+ not be as complete as with random maps, this option is
+ disabled by default.
+
nice=int Run the job with the given nice value. See man nice(2).
prio=int Set the io priority value of this job. Linux limits us to
nice=int Run the job with the given nice value. See man nice(2).
prio=int Set the io priority value of this job. Linux limits us to
--eta=when When ETA estimate should be printed
May be "always", "never" or "auto"
--section=name Only run specified section in job file
--eta=when When ETA estimate should be printed
May be "always", "never" or "auto"
--section=name Only run specified section in job file
+ --alloc-size=kb Set smalloc pool to this size in kb (def 1024)
Any parameters following the options will be assumed to be job files,
Any parameters following the options will be assumed to be job files,
option only applies to job sections, the reserved 'global' section is
always parsed and taken into account.
option only applies to job sections, the reserved 'global' section is
always parsed and taken into account.
+Fio has an internal allocator for shared memory called smalloc. It
+allocates shared structures from this pool. The pool defaults to 1024k
+in size, and can grow to 32 pools. If running large jobs with randommap
+enabled it can run out of memory, in which case the --alloc-size switch
+is handy for starting with a larger pool size.
+
f->num_maps = num_maps;
continue;
}
f->num_maps = num_maps;
continue;
}
+ if (!td->o.softrandommap) {
+ log_err("fio: failed allocating random map. If running"
+ " a large number of jobs, try the 'norandommap'"
+ " option or set 'softrandommap'. Or give"
+ " a larger --alloc-size to fio.\n");
+ return 1;
+ }
log_info("fio: file %s failed allocating random map. Running "
"job without.\n", f->file_name);
log_info("fio: file %s failed allocating random map. Running "
"job without.\n", f->file_name);
unsigned int write_lat_log;
unsigned int write_bw_log;
unsigned int norandommap;
unsigned int write_lat_log;
unsigned int write_bw_log;
unsigned int norandommap;
+ unsigned int softrandommap;
unsigned int bs_unaligned;
unsigned int fsync_on_close;
unsigned int bs_unaligned;
unsigned int fsync_on_close;
.has_arg = required_argument,
.val = 'x',
},
.has_arg = required_argument,
.val = 'x',
},
+ {
+ .name = "alloc-size",
+ .has_arg = required_argument,
+ .val = 'a',
+ },
printf("\t--readonly\tTurn on safety read-only checks, preventing"
" writes\n");
printf("\t--section=name\tOnly run specified section in job file\n");
printf("\t--readonly\tTurn on safety read-only checks, preventing"
" writes\n");
printf("\t--section=name\tOnly run specified section in job file\n");
+ printf("\t--alloc-size=kb\tSet smalloc pool to this size in kb"
+ " (def 1024)\n");
while ((c = getopt_long_only(argc, argv, "", l_opts, &lidx)) != -1) {
switch (c) {
while ((c = getopt_long_only(argc, argv, "", l_opts, &lidx)) != -1) {
switch (c) {
+ case 'a':
+ smalloc_pool_size = atoi(optarg);
+ break;
case 't':
def_timeout = atoi(optarg);
break;
case 't':
def_timeout = atoi(optarg);
break;
.help = "Accept potential duplicate random blocks",
.parent = "rw",
},
.help = "Accept potential duplicate random blocks",
.parent = "rw",
},
+ {
+ .name = "softrandommap",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(softrandommap),
+ .help = "Allow randommap to fail and continue witout",
+ .parent = "norandommap",
+ .def = "0",
+ },
{
.name = "nrfiles",
.type = FIO_OPT_INT,
{
.name = "nrfiles",
.type = FIO_OPT_INT,
#define INITIAL_SIZE 1048576 /* new pool size */
#define MAX_POOLS 32 /* maximum number of pools to setup */
#define INITIAL_SIZE 1048576 /* new pool size */
#define MAX_POOLS 32 /* maximum number of pools to setup */
+unsigned int smalloc_pool_size = INITIAL_SIZE;
+
-#define MAX_SIZE 8 * INITIAL_SIZE
+#define MAX_SIZE 8 * smalloc_pool_size
static unsigned int resize_error;
#endif
static unsigned int resize_error;
#endif
if (fd < 0)
goto out_close;
if (fd < 0)
goto out_close;
- pool->size = INITIAL_SIZE;
+ pool->size = smalloc_pool_size;
if (ftruncate(fd, pool->size) < 0)
goto out_unlink;
if (ftruncate(fd, pool->size) < 0)
goto out_unlink;
extern void sinit(void);
extern void scleanup(void);
extern void sinit(void);
extern void scleanup(void);
+extern unsigned int smalloc_pool_size;
+