A number between zero and one that indicates the ratio of written bytes
in the zones with write pointers in the IO range to the size of the IO
range. When current ratio is above this ratio, zones are reset
- periodically as :option:`zone_reset_frequency` specifies.
+ periodically as :option:`zone_reset_frequency` specifies. If there are
+ multiple jobs when using this option, the IO range for all write jobs
+ has to be the same.
.. option:: zone_reset_frequency=float
A number between zero and one that indicates the ratio of written bytes in the
zones with write pointers in the IO range to the size of the IO range. When
current ratio is above this ratio, zones are reset periodically as
-\fBzone_reset_frequency\fR specifies.
+\fBzone_reset_frequency\fR specifies. If there are multiple jobs when using this
+option, the IO range for all write jobs has to be the same.
.TP
.BI zone_reset_frequency \fR=\fPfloat
A number between zero and one that indicates how often a zone reset should be
}
/* Whether or not the I/O range for f includes one or more sequential zones */
-static bool zbd_is_seq_job(struct fio_file *f)
+static bool zbd_is_seq_job(const struct fio_file *f)
{
uint32_t zone_idx, zone_idx_b, zone_idx_e;
{
struct fio_zone_info *zb, *ze, *z;
uint64_t wp_vdb = 0;
+ struct zoned_block_device_info *zbdi = f->zbd_info;
if (!accounting_vdb(td, f))
return 0;
+ /*
+ * Ensure that the I/O range includes one or more sequential zones so
+ * that f->min_zone and f->max_zone have different values.
+ */
+ if (!zbd_is_seq_job(f))
+ return 0;
+
+ if (zbdi->write_min_zone != zbdi->write_max_zone) {
+ if (zbdi->write_min_zone != f->min_zone ||
+ zbdi->write_max_zone != f->max_zone) {
+ td_verror(td, EINVAL,
+ "multi-jobs with different write ranges are "
+ "not supported with zone_reset_threshold");
+ log_err("multi-jobs with different write ranges are "
+ "not supported with zone_reset_threshold\n");
+ }
+ return 0;
+ }
+
+ zbdi->write_min_zone = f->min_zone;
+ zbdi->write_max_zone = f->max_zone;
+
zb = zbd_get_zone(f, f->min_zone);
ze = zbd_get_zone(f, f->max_zone);
for (z = zb; z < ze; z++) {
}
}
- pthread_mutex_lock(&f->zbd_info->mutex);
- f->zbd_info->wp_valid_data_bytes = wp_vdb;
- pthread_mutex_unlock(&f->zbd_info->mutex);
+ pthread_mutex_lock(&zbdi->mutex);
+ zbdi->wp_valid_data_bytes = wp_vdb;
+ pthread_mutex_unlock(&zbdi->mutex);
for (z = zb; z < ze; z++)
if (z->has_wp)
* num_open_zones).
* @zone_size: size of a single zone in bytes.
* @wp_valid_data_bytes: total size of data in zones with write pointers
+ * @write_min_zone: Minimum zone index of all job's write ranges. Inclusive.
+ * @write_max_zone: Maximum zone index of all job's write ranges. Exclusive.
* @zone_size_log2: log2 of the zone size in bytes if it is a power of 2 or 0
* if the zone size is not a power of 2.
* @nr_zones: number of zones
pthread_mutex_t mutex;
uint64_t zone_size;
uint64_t wp_valid_data_bytes;
+ uint32_t write_min_zone;
+ uint32_t write_max_zone;
uint32_t zone_size_log2;
uint32_t nr_zones;
uint32_t refcount;