.. option:: exitall
- By default, fio will continue running all other jobs when one job finishes
- but sometimes this is not the desired action. Setting ``exitall`` will
- instead make fio terminate all other jobs when one job finishes.
+ By default, fio will continue running all other jobs when one job finishes.
+ Sometimes this is not the desired action. Setting ``exitall`` will instead
+ make fio terminate all jobs in the same group, as soon as one job of that
+ group finishes.
+
+.. option:: exit_what
+
+ By default, fio will continue running all other jobs when one job finishes.
+ Sometimes this is not the desired action. Setting ``exit_all`` will
+ instead make fio terminate all jobs in the same group. The option
+ ``exit_what`` allows to control which jobs get terminated when ``exitall`` is
+ enabled. The default is ``group`` and does not change the behaviour of
+ ``exitall``. The setting ``all`` terminates all jobs. The setting ``stonewall``
+ terminates all currently running jobs across all groups and continues execution
+ with the next stonewalled group.
.. option:: exec_prerun=str
exit_value = 128;
}
- fio_terminate_threads(TERMINATE_ALL);
+ fio_terminate_threads(TERMINATE_ALL, TERMINATE_ALL);
}
}
if (!in_ramp_time(td) && should_check_rate(td)) {
if (check_min_rate(td, &comp_time)) {
if (exitall_on_terminate || td->o.exitall_error)
- fio_terminate_threads(td->groupid);
+ fio_terminate_threads(td->groupid, td->o.exit_what);
td_verror(td, EIO, "check_min_rate");
break;
}
exec_string(o, o->exec_postrun, (const char *)"postrun");
if (exitall_on_terminate || (o->exitall_error && td->error))
- fio_terminate_threads(td->groupid);
+ fio_terminate_threads(td->groupid, td->o.exit_what);
err:
if (td->error)
}
if (*nr_running == cputhreads && !pending && realthreads)
- fio_terminate_threads(TERMINATE_ALL);
+ fio_terminate_threads(TERMINATE_ALL, TERMINATE_ALL);
}
static bool __check_trigger_file(void)
fio_clients_send_trigger(trigger_remote_cmd);
else {
verify_save_state(IO_LIST_ALL);
- fio_terminate_threads(TERMINATE_ALL);
+ fio_terminate_threads(TERMINATE_ALL, TERMINATE_ALL);
exec_trigger(trigger_cmd);
}
}
dprint(FD_MUTEX, "wait on startup_sem\n");
if (fio_sem_down_timeout(startup_sem, 10000)) {
log_err("fio: job startup hung? exiting.\n");
- fio_terminate_threads(TERMINATE_ALL);
+ fio_terminate_threads(TERMINATE_ALL, TERMINATE_ALL);
fio_abort = true;
nr_started--;
free(fd);
o->loops = le32_to_cpu(top->loops);
o->mem_type = le32_to_cpu(top->mem_type);
o->mem_align = le32_to_cpu(top->mem_align);
- o->stonewall = le32_to_cpu(top->stonewall);
+ o->exit_what = le16_to_cpu(top->exit_what);
+ o->stonewall = le16_to_cpu(top->stonewall);
o->new_group = le32_to_cpu(top->new_group);
o->numjobs = le32_to_cpu(top->numjobs);
o->cpus_allowed_policy = le32_to_cpu(top->cpus_allowed_policy);
top->loops = cpu_to_le32(o->loops);
top->mem_type = cpu_to_le32(o->mem_type);
top->mem_align = cpu_to_le32(o->mem_align);
- top->stonewall = cpu_to_le32(o->stonewall);
+ top->exit_what = cpu_to_le16(o->exit_what);
+ top->stonewall = cpu_to_le16(o->stonewall);
top->new_group = cpu_to_le32(o->new_group);
top->numjobs = cpu_to_le32(o->numjobs);
top->cpus_allowed_policy = cpu_to_le32(o->cpus_allowed_policy);
\fBgroup_reporting\fR.
.TP
.BI exitall
-By default, fio will continue running all other jobs when one job finishes
-but sometimes this is not the desired action. Setting \fBexitall\fR will
-instead make fio terminate all other jobs when one job finishes.
+By default, fio will continue running all other jobs when one job finishes.
+Sometimes this is not the desired action. Setting \fBexitall\fR will instead
+make fio terminate all jobs in the same group, as soon as one job of that
+group finishes.
+.TP
+.BI exit_what
+By default, fio will continue running all other jobs when one job finishes.
+Sometimes this is not the desired action. Setting \fBexit_all\fR will instead
+make fio terminate all jobs in the same group. The option \fBexit_what\fR
+allows to control which jobs get terminated when \fBexitall\fR is enabled. The
+default is \fBgroup\fR and does not change the behaviour of \fBexitall\fR. The
+setting \fBall\fR terminates all jobs. The setting \fBstonewall\fR terminates
+all currently running jobs across all groups and continues execution with the
+next stonewalled group.
.TP
.BI exec_prerun \fR=\fPstr
Before running this job, issue the command specified through
*/
#define FIO_REAP_TIMEOUT 300
-#define TERMINATE_ALL (-1U)
-extern void fio_terminate_threads(unsigned int);
+enum {
+ TERMINATE_NONE = 0,
+ TERMINATE_GROUP = 1,
+ TERMINATE_STONEWALL = 2,
+ TERMINATE_ALL = -1,
+};
+
+extern void fio_terminate_threads(unsigned int, unsigned int);
extern void fio_mark_td_terminate(struct thread_data *);
/*
td->terminate = true;
}
-void fio_terminate_threads(unsigned int group_id)
+void fio_terminate_threads(unsigned int group_id, unsigned int terminate)
{
struct thread_data *td;
pid_t pid = getpid();
dprint(FD_PROCESS, "terminate group_id=%d\n", group_id);
for_each_td(td, i) {
- if (group_id == TERMINATE_ALL || group_id == td->groupid) {
+ if ((terminate == TERMINATE_GROUP && group_id == TERMINATE_ALL) ||
+ (terminate == TERMINATE_GROUP && group_id == td->groupid) ||
+ (terminate == TERMINATE_STONEWALL && td->runstate >= TD_RUNNING) ||
+ (terminate == TERMINATE_ALL)) {
dprint(FD_PROCESS, "setting terminate on %s/%d\n",
td->o.name, (int) td->pid);
.category = FIO_OPT_C_GENERAL,
.group = FIO_OPT_G_PROCESS,
},
+ {
+ .name = "exit_what",
+ .lname = "What jobs to quit on terminate",
+ .type = FIO_OPT_STR,
+ .off1 = offsetof(struct thread_options, exit_what),
+ .help = "Fine-grained control for exitall",
+ .def = "group",
+ .category = FIO_OPT_C_GENERAL,
+ .group = FIO_OPT_G_PROCESS,
+ .posval = {
+ { .ival = "group",
+ .oval = TERMINATE_GROUP,
+ .help = "exit_all=1 default behaviour",
+ },
+ { .ival = "stonewall",
+ .oval = TERMINATE_STONEWALL,
+ .help = "quit all currently running jobs; continue with next stonewall",
+ },
+ { .ival = "all",
+ .oval = TERMINATE_ALL,
+ .help = "Quit everything",
+ },
+ },
+ },
{
.name = "exitall_on_error",
.lname = "Exit-all on terminate in error",
} else
fio_net_queue_cmd(FIO_NET_CMD_VTRIGGER, rep, sz, NULL, SK_F_FREE | SK_F_INLINE);
- fio_terminate_threads(TERMINATE_ALL);
+ fio_terminate_threads(TERMINATE_ALL, TERMINATE_ALL);
fio_server_check_jobs(job_list);
exec_trigger(buf);
return 0;
switch (cmd->opcode) {
case FIO_NET_CMD_QUIT:
- fio_terminate_threads(TERMINATE_ALL);
+ fio_terminate_threads(TERMINATE_ALL, TERMINATE_ALL);
ret = 0;
break;
case FIO_NET_CMD_EXIT:
unsigned long long max_latency;
- unsigned int stonewall;
+ unsigned short exit_what;
+ unsigned short stonewall;
unsigned int new_group;
unsigned int numjobs;
os_cpu_mask_t cpumask;
uint32_t mem_type;
uint32_t mem_align;
- uint32_t stonewall;
+ uint16_t exit_what;
+ uint16_t stonewall;
uint32_t new_group;
uint32_t numjobs;
/*