Recent changes (master)

Jens Axboe <[email protected]> Wed, 10 Jun 2026 06:00:02 -0600
Newsgroups org.kernel.vger.fio
Message-ID <[email protected]>
The following changes since commit cf144e06b4f98492f6ca8a17157bcf284b3f64a4:

  t/run-fio-tests: add verify_state_save.py (2026-06-08 14:05:55 -0400)

are available in the Git repository at:

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

for you to fetch changes up to f055bacb90990b96fe9940579b3f7eda3515679f:

  t/nvmept_write_mode: fix fio path (2026-06-10 00:21:19 +0000)

----------------------------------------------------------------
Vincent Fu (2):
      mem: adjust alloc size for [rand]trimwrite workloads
      t/nvmept_write_mode: fix fio path

 backend.c              | 21 ++++++++++++++++++++-
 t/nvmept_write_mode.py |  2 +-
 2 files changed, 21 insertions(+), 2 deletions(-)

---

Diff of recent changes:

diff --git a/backend.c b/backend.c
index af5a22b7..8ff3bc12 100644
--- a/backend.c
+++ b/backend.c
@@ -1574,7 +1574,26 @@ int init_io_u_buffers(struct thread_data *td)
 	char *p;
 
 	max_units = td->o.iodepth;
-	if (td->trim_verify && td->o.trim_zero)
+
+	/*
+	 * Trim operations do not involve data transfer. So we typically do not
+	 * have to account for trim sizes when allocating buffers. However,
+	 * there are exceptions:
+	 *
+	 * - if we are in trim verify mode we need a data buffer the same size
+	 *   as the trimmed range in order to confirm that the trimmed offset
+	 *   is all zeroes when we read it back
+	 * - if we are in [rand]trimwrite mode we need a data buffer the same
+	 *   size as the trimmed range in order to write data at the trimmed
+	 *   offset
+	 * - however, fio can mistakenly believe it is in [rand]trimwrite mode
+	 *   if it encounters trim and write operations when reading an iolog.
+	 *   So when replaying an iolog we do not need to account for trim
+	 *   sizes when allocating buffers even if the [rand]trimwrite check
+	 *   returns true because this is a false positive.
+	 */
+	if ((td->trim_verify && td->o.trim_zero) ||
+			(!(td->flags & TD_F_READ_IOLOG) && td_trimwrite(td)))
 		max_bs = td_max_bs(td);
 	else
 		max_bs = td_max_rw_bs(td);
diff --git a/t/nvmept_write_mode.py b/t/nvmept_write_mode.py
index b52bd8b0..21a6ea1e 100755
--- a/t/nvmept_write_mode.py
+++ b/t/nvmept_write_mode.py
@@ -261,7 +261,7 @@ def main():
     if args.fio:
         fio_path = str(Path(args.fio).absolute())
     else:
-        fio_root = str(Path(__file__).absolute().parent.parent)
+        fio_path = os.path.join(str(Path(__file__).absolute().parent.parent), "fio")
     print(f"fio path is {fio_path}")
 
     for test in TEST_LIST: