Get rid of io engine ops SIGTERM flag, it didn't really
work.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
if (WIFSIGNALED(status)) {
int sig = WTERMSIG(status);
if (WIFSIGNALED(status)) {
int sig = WTERMSIG(status);
+ if (sig != SIGTERM && sig != SIGUSR2)
log_err("fio: pid=%d, got signal=%d\n",
(int) td->pid, sig);
td->sig = sig;
log_err("fio: pid=%d, got signal=%d\n",
(int) td->pid, sig);
td->sig = sig;
+static void fio_netio_terminate(struct thread_data *td)
+{
+ kill(td->pid, SIGUSR2);
+}
+
#ifdef FIO_HAVE_SPLICE
static int fio_netio_setup_splice(struct thread_data *td)
{
#ifdef FIO_HAVE_SPLICE
static int fio_netio_setup_splice(struct thread_data *td)
{
.init = fio_netio_init,
.cleanup = fio_netio_cleanup,
.open_file = fio_netio_open_file,
.init = fio_netio_init,
.cleanup = fio_netio_cleanup,
.open_file = fio_netio_open_file,
- .close_file = generic_close_file,
+ .close_file = fio_netio_close_file,
+ .terminate = fio_netio_terminate,
.options = options,
.option_struct_size = sizeof(struct netio_options),
.flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR |
.options = options,
.option_struct_size = sizeof(struct netio_options),
.flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR |
- FIO_SIGTERM | FIO_PIPEIO,
.cleanup = fio_netio_cleanup,
.open_file = fio_netio_open_file,
.close_file = fio_netio_close_file,
.cleanup = fio_netio_cleanup,
.open_file = fio_netio_open_file,
.close_file = fio_netio_close_file,
+ .terminate = fio_netio_terminate,
.options = options,
.option_struct_size = sizeof(struct netio_options),
.flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR |
.options = options,
.option_struct_size = sizeof(struct netio_options),
.flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR |
- FIO_SIGTERM | FIO_PIPEIO,
};
static int str_hostname_cb(void *data, const char *input)
};
static int str_hostname_cb(void *data, const char *input)
TD_NOT_CREATED = 0,
TD_CREATED,
TD_INITIALIZED,
TD_NOT_CREATED = 0,
TD_CREATED,
TD_INITIALIZED,
TD_RUNNING,
TD_PRE_READING,
TD_VERIFYING,
TD_RUNNING,
TD_PRE_READING,
TD_VERIFYING,
#ifndef FIO_IOENGINE_H
#define FIO_IOENGINE_H
#ifndef FIO_IOENGINE_H
#define FIO_IOENGINE_H
-#define FIO_IOOPS_VERSION 13
+#define FIO_IOOPS_VERSION 14
enum {
IO_U_F_FREE = 1 << 0,
enum {
IO_U_F_FREE = 1 << 0,
int (*open_file)(struct thread_data *, struct fio_file *);
int (*close_file)(struct thread_data *, struct fio_file *);
int (*get_file_size)(struct thread_data *, struct fio_file *);
int (*open_file)(struct thread_data *, struct fio_file *);
int (*close_file)(struct thread_data *, struct fio_file *);
int (*get_file_size)(struct thread_data *, struct fio_file *);
+ void (*terminate)(struct thread_data *);
int option_struct_size;
struct fio_option *options;
void *data;
int option_struct_size;
struct fio_option *options;
void *data;
FIO_NODISKUTIL = 1 << 4, /* diskutil can't handle filename */
FIO_UNIDIR = 1 << 5, /* engine is uni-directional */
FIO_NOIO = 1 << 6, /* thread does only pseudo IO */
FIO_NODISKUTIL = 1 << 4, /* diskutil can't handle filename */
FIO_UNIDIR = 1 << 5, /* engine is uni-directional */
FIO_NOIO = 1 << 6, /* thread does only pseudo IO */
- FIO_SIGTERM = 1 << 7, /* needs SIGTERM to exit */
- FIO_PIPEIO = 1 << 8, /* input/output no seekable */
- FIO_BARRIER = 1 << 9, /* engine supports barriers */
- FIO_MEMALIGN = 1 << 10, /* engine wants aligned memory */
+ FIO_PIPEIO = 1 << 7, /* input/output no seekable */
+ FIO_BARRIER = 1 << 8, /* engine supports barriers */
+ FIO_MEMALIGN = 1 << 9, /* engine wants aligned memory */
/*
* if the thread is running, just let it exit
*/
/*
* if the thread is running, just let it exit
*/
+ if (!td->pid || pid == td->pid)
continue;
else if (td->runstate < TD_RAMP)
kill(td->pid, SIGTERM);
continue;
else if (td->runstate < TD_RAMP)
kill(td->pid, SIGTERM);
- else if (pid != td->pid) {
struct ioengine_ops *ops = td->io_ops;
struct ioengine_ops *ops = td->io_ops;
- if (ops && (ops->flags & FIO_SIGTERM))
- kill(td->pid, SIGTERM);
+ if (ops && ops->terminate)
+ ops->terminate(td);