can do so by passing an empty read size - bs=,8k will set
8k for writes and leave the read default value.
+blockalign=int
+ba=int At what boundary to align random IO offsets. Defaults to
+ the same as 'blocksize' the minimum blocksize given.
+ Minimum alignment is typically 512b for using direct IO,
+ though it usually depends on the hardware block size. This
+ option is mutually exclusive with using a random map for
+ files, so it will turn off that option.
+
blocksize_range=irange
bsrange=irange Instead of giving a single block size, specify a range
and fio will mix the issued io block sizes. The issued
If set, any size in \fBblocksize_range\fR may be used. This typically won't
work with direct I/O, as that normally requires sector alignment.
.TP
+.BI blockalign \fR=\fPint[,int] "\fR,\fB ba" \fR=\fPint[,int]
+At what boundary to align random IO offsets. Defaults to the same as
+'blocksize' the minimum blocksize given. Minimum alignment is typically 512b
+for using direct IO, though it usually depends on the hardware block size.
+This option is mutually exclusive with using a random map for files, so it
+will turn off that option.
.B zero_buffers
Initialise buffers with all zeros. Default: fill buffers with random data.
.TP
unsigned long long start_offset;
unsigned int bs[2];
+ unsigned int ba[2];
unsigned int min_bs[2];
unsigned int max_bs[2];
struct bssplit *bssplit;
o->rw_min_bs = min(o->min_bs[DDIR_READ], o->min_bs[DDIR_WRITE]);
+ /*
+ * For random IO, allow blockalign offset other than min_bs.
+ */
+ if (!o->ba[DDIR_READ] || !td_random(td))
+ o->ba[DDIR_READ] = o->min_bs[DDIR_READ];
+ if (!o->ba[DDIR_WRITE] || !td_random(td))
+ o->ba[DDIR_WRITE] = o->min_bs[DDIR_WRITE];
+
+ if ((o->ba[DDIR_READ] != o->min_bs[DDIR_READ] ||
+ o->ba[DDIR_WRITE] != o->min_bs[DDIR_WRITE]) &&
+ !td->o.norandommap) {
+ log_err("fio: Any use of blockalign= turns off randommap\n");
+ td->o.norandommap = 1;
+ }
+
if (!o->file_size_high)
o->file_size_high = o->file_size_low;
if (max_size > f->real_file_size)
max_size = f->real_file_size;
- max_blocks = max_size / (unsigned long long) td->o.min_bs[ddir];
+ max_blocks = max_size / (unsigned long long) td->o.ba[ddir];
if (!max_blocks)
return 0;
b = (f->last_pos - f->file_offset) / td->o.min_bs[ddir];
}
- io_u->offset = b * td->o.min_bs[ddir];
+ io_u->offset = b * td->o.ba[ddir];
if (io_u->offset >= f->io_size) {
dprint(FD_IO, "get_next_offset: offset %llu >= io_size %llu\n",
io_u->offset, f->io_size);
.def = "4k",
.parent = "rw",
},
+ {
+ .name = "ba",
+ .alias = "blockalign",
+ .type = FIO_OPT_STR_VAL_INT,
+ .off1 = td_var_offset(ba[DDIR_READ]),
+ .off2 = td_var_offset(ba[DDIR_WRITE]),
+ .minval = 1,
+ .help = "IO block offset alignment",
+ .parent = "rw",
+ },
{
.name = "bsrange",
.alias = "blocksize_range",