From a1dedc1f6347a33fd1265348db86a9258cadefd2 Mon Sep 17 00:00:00 2001 From: Aaron Carroll Date: Wed, 20 Feb 2008 09:14:12 +0100 Subject: [PATCH] account for delayed jobs when reaping threads reap_threads does not account for jobs that have been delayed (e.g. via startdelay) which may lead to all threads being terminated. The following job file demonstrates the problem: [job1] filename=job1file size=16k startdelay=1 Signed-off-by: Aaron Carroll Signed-off-by: Jens Axboe --- fio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fio.c b/fio.c index 355d8730..6e25c5fe 100644 --- a/fio.c +++ b/fio.c @@ -1024,7 +1024,11 @@ static void reap_threads(int *nr_running, int *t_rate, int *m_rate) else realthreads++; - if (!td->pid || td->runstate == TD_REAPED) + if (!td->pid) { + pending++; + continue; + } + if (td->runstate == TD_REAPED) continue; if (td->o.use_thread) { if (td->runstate == TD_EXITED) { -- 2.25.1