Gently prod children with a SIGQUIT on terminate
authorJens Axboe <jens.axboe@oracle.com>
Mon, 5 Mar 2007 11:32:32 +0000 (12:32 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 5 Mar 2007 11:32:32 +0000 (12:32 +0100)
This should unstuck most loops.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c

diff --git a/fio.c b/fio.c
index b668d856e9d3e9fd49c0ffc807ece26625f61d13..d426ad66f9439a4d5da5f14092d3db8f5b4d628d 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -67,6 +67,7 @@ static void terminate_threads(int group_id, int forced_kill)
 
        for_each_td(td, i) {
                if (group_id == TERMINATE_ALL || groupid == td->groupid) {
 
        for_each_td(td, i) {
                if (group_id == TERMINATE_ALL || groupid == td->groupid) {
+                       kill(td->pid, SIGQUIT);
                        td->terminate = 1;
                        td->start_delay = 0;
                        if (forced_kill)
                        td->terminate = 1;
                        td->start_delay = 0;
                        if (forced_kill)
@@ -893,7 +894,8 @@ static void reap_threads(int *nr_running, int *t_rate, int *m_rate)
                        if (WIFSIGNALED(status)) {
                                int sig = WTERMSIG(status);
 
                        if (WIFSIGNALED(status)) {
                                int sig = WTERMSIG(status);
 
-                               log_err("fio: pid=%d, got signal=%d\n", td->pid, sig);
+                               if (sig != SIGQUIT)
+                                       log_err("fio: pid=%d, got signal=%d\n", td->pid, sig);
                                td_set_runstate(td, TD_REAPED);
                                goto reaped;
                        }
                                td_set_runstate(td, TD_REAPED);
                                goto reaped;
                        }