Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@meta.com>
To: <fio@vger.kernel.org>
Cc: <axboe@kernel.dk>, <vincentfu@gmail.com>,
	Keith Busch <kbusch@kernel.org>
Subject: [PATCHv2 1/4] eta: count a job that is setting up as running
Date: Thu, 10 Sep 2026 09:13:07 -0700	[thread overview]
Message-ID: <20260910161310.1478081-2-kbusch@meta.com> (raw)
In-Reply-To: <20260910161310.1478081-1-kbusch@meta.com>

From: Keith Busch <kbusch@kernel.org>

TD_RAMP increments both nr_running and nr_ramp, so nr_ramp is a subset
of nr_running and display_thread_status() can compare the two. The
TD_SETTING_UP side would increment only nr_setting_up, yet the
percentage calculation scales by nr_setting_up / nr_running, a ratio
that only means anything if setting up jobs are counted in nr_running as
well: the existing ratio can drive the multiplier negative.

A job that is setting up is started and doing work, it just has not
issued IO yet, so count it in nr_running and treat nr_setting_up as the
subset as intended. Today this only covers the brief windows where
setup_files() and pre_read_file() bump the state, but it means the
status line reports such a job instead of suppressing the whole line.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 eta.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/eta.c b/eta.c
index c6e3cffb..70efc208 100644
--- a/eta.c
+++ b/eta.c
@@ -466,9 +466,10 @@ static bool calc_thread_status(struct jobs_eta *je, int force)
 		} else if (td->runstate == TD_RAMP) {
 			je->nr_running++;
 			je->nr_ramp++;
-		} else if (td->runstate == TD_SETTING_UP)
+		} else if (td->runstate == TD_SETTING_UP) {
+			je->nr_running++;
 			je->nr_setting_up++;
-		else if (td->runstate < TD_RUNNING)
+		} else if (td->runstate < TD_RUNNING)
 			je->nr_pending++;
 
 		if (je->elapsed_sec >= 3)
-- 
2.53.0-Meta


  reply	other threads:[~2026-09-10 16:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 16:13 [PATCHv2 0/4] fio: fix eta Keith Busch
2026-09-10 16:13 ` Keith Busch [this message]
2026-09-10 16:13 ` [PATCHv2 2/4] backend: don't mark a job as running before it has set up Keith Busch
2026-09-11 19:49   ` Vincent Fu
2026-09-10 16:13 ` [PATCHv2 3/4] eta: cap the ETA at the job's own remaining runtime Keith Busch
2026-09-10 16:13 ` [PATCHv2 4/4] eta: remove now unused done_secs Keith Busch
2026-09-11 19:45 ` [PATCHv2 0/4] fio: fix eta Vincent Fu
2026-09-11 21:09 ` fiotestbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260910161310.1478081-2-kbusch@meta.com \
    --to=kbusch@meta.com \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=kbusch@kernel.org \
    --cc=vincentfu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox