Recent changes (master)

Jens Axboe <[email protected]> Wed, 25 Feb 2026 06:00:01 -0700
Newsgroups org.kernel.vger.fio
Message-ID <[email protected]>
The following changes since commit 1a04e5746c28316bd8a64825bf2b5739dc01c589:

  stat: Remove duplicate space in __show_run_stats() (2026-02-13 11:44:32 -0500)

are available in the Git repository at:

  git://git.kernel.dk/fio.git master

for you to fetch changes up to 411de8ecef63194adf805d4807b5dc3730571655:

  Merge branch 'offload_stability' of https://github.com/tomas-winkler-sndk/fio (2026-02-24 08:03:09 -0700)

----------------------------------------------------------------
Chana Zaks (1):
      time: fix ramp completion offload workers

Jens Axboe (1):
      Merge branch 'offload_stability' of https://github.com/tomas-winkler-sndk/fio

Tomas Winkler (1):
      libfio: fix crash when io_submit_mode=offload

 libfio.c | 19 ++++++++++++++++---
 time.c   |  9 +++++++++
 2 files changed, 25 insertions(+), 3 deletions(-)

---

Diff of recent changes:

diff --git a/libfio.c b/libfio.c
index 57f3f858..52afeafb 100644
--- a/libfio.c
+++ b/libfio.c
@@ -132,15 +132,28 @@ void clear_io_state(struct thread_data *td, int all)
 	clear_inflight(td);
 }
 
-void reset_all_stats(struct thread_data *td)
+/*
+ * Update thinktime block counter
+ */
+static void update_thinktime_blocks_counter(struct thread_data *td)
 {
 	unsigned long long b;
-	int i;
 
-	reset_io_counters(td, 1);
+	/* an offload worker has no thinktime blocks counters initialized */
+	if (!td->thinktime_blocks_counter)
+		return;
 
 	b = ddir_rw_sum(td->thinktime_blocks_counter);
 	td->last_thinktime_blocks -= b;
+}
+
+void reset_all_stats(struct thread_data *td)
+{
+	int i;
+
+	reset_io_counters(td, 1);
+
+	update_thinktime_blocks_counter(td);
 
 	for (i = 0; i < DDIR_RWDIR_CNT; i++) {
 		td->io_bytes[i] = 0;
diff --git a/time.c b/time.c
index 386c76fc..71dc7b15 100644
--- a/time.c
+++ b/time.c
@@ -197,6 +197,15 @@ static bool parent_update_ramp(struct thread_data *td)
 
 bool ramp_period_over(struct thread_data *td)
 {
+	/*
+	 * In offload mode, ramp state is tracked on the parent job td.
+	 * The transition to RAMP_FINISHING is handled by the parent, so
+	 * propagate it here to ensure the worker advances to RAMP_DONE.
+	 */
+	if (td->o.io_submit_mode == IO_MODE_OFFLOAD && td->parent &&
+	    td->parent->ramp_period_state == RAMP_FINISHING)
+		td->ramp_period_state = RAMP_FINISHING;
+
 	if (td->ramp_period_state == RAMP_DONE)
 		return true;