}
#ifdef FIO_HAVE_CPU_AFFINITY
-int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu)
+int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu_index)
{
+ unsigned int i, index, cpus_in_mask;
const long max_cpu = cpus_online();
- unsigned int i;
+ cpus_in_mask = fio_cpu_count(mask);
+ cpu_index = cpu_index % cpus_in_mask;
+
+ index = 0;
for (i = 0; i < max_cpu; i++) {
- if (cpu != i) {
- fio_cpu_clear(mask, i);
+ if (!fio_cpu_isset(mask, i))
continue;
- }
+
+ if (cpu_index != index)
+ fio_cpu_clear(mask, i);
+
+ index++;
}
return fio_cpu_count(mask);
return ret;
}
+static int str_buffer_compress_cb(void *data, unsigned long long *il)
+{
+ struct thread_data *td = data;
+
+ td->flags |= TD_F_COMPRESS;
+ td->o.compress_percentage = *il;
+ return 0;
+}
+
static int str_verify_pattern_cb(void *data, const char *input)
{
struct thread_data *td = data;
.category = FIO_OPT_C_FILE,
.group = FIO_OPT_G_INVALID,
},
+ {
+ .name = "file_append",
+ .lname = "File append",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(file_append),
+ .help = "IO will start at the end of the file(s)",
+ .def = "0",
+ .category = FIO_OPT_C_FILE,
+ .group = FIO_OPT_G_INVALID,
+ },
{
.name = "offset",
.lname = "IO offset",
.name = "buffer_compress_percentage",
.lname = "Buffer compression percentage",
.type = FIO_OPT_INT,
- .off1 = td_var_offset(compress_percentage),
+ .cb = str_buffer_compress_cb,
.maxval = 100,
.minval = 0,
.help = "How compressible the buffer is (approximately)",