From 3eeb162085b43311546e395039c19664ea781b0f Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 13 Sep 2017 09:03:20 -0600 Subject: [PATCH] time: ensure that offload mode switches parent out of ramp If we have worker threads submitting IO for the jobs AND using ramp time, then we need to ensure that the parent job is switched out of ramp mode. This normally happens as part of IO submission, but since we have worker threads doing that for us, it never happens for the parent. Fixes: https://github.com/axboe/fio/issues/459 Signed-off-by: Jens Axboe --- time.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/time.c b/time.c index 07984190..28c20717 100644 --- a/time.c +++ b/time.c @@ -97,16 +97,17 @@ bool in_ramp_time(struct thread_data *td) return td->o.ramp_time && !td->ramp_time_over; } -static void parent_update_ramp(struct thread_data *td) +static bool parent_update_ramp(struct thread_data *td) { struct thread_data *parent = td->parent; if (!parent || parent->ramp_time_over) - return; + return false; reset_all_stats(parent); parent->ramp_time_over = 1; td_set_runstate(parent, TD_RAMP); + return true; } bool ramp_time_over(struct thread_data *td) @@ -118,7 +119,15 @@ bool ramp_time_over(struct thread_data *td) td->ramp_time_over = 1; reset_all_stats(td); td_set_runstate(td, TD_RAMP); - parent_update_ramp(td); + + /* + * If we have a parent, the parent isn't doing IO. Hence + * the parent never enters do_io(), which will switch us + * from RAMP -> RUNNING. Do this manually here. + */ + if (parent_update_ramp(td)) + td_set_runstate(td, TD_RUNNING); + return true; } -- 2.25.1