Skip to contentSkip to conversation

block/005|008: double timeout on machines with more than 128 CPUs

PATCH In review Li Chen 2 participants 3 messages Jun 24, 2025 – Jun 26, 2025 Block layer

lore
Share & tools
lore

Li Chen

author
#0 lore raw

PATCH 1/1 block/005|008: double timeout on machines with more than 128 CPUs

From: Li Chen <[email protected]>

The current hard-coded timeout for block/005 and 008 is 900 s. On large systems (e.g. 256 C) the test spawns one fio job per CPU and therefore issues 1 GiB of random I/O per job. Total workload scales linearly with the CPU-count, so the original 900 s window is often insufficient for high-core machines and causes false failures:

fio did not finish after 900 seconds!

To keep the logic simple while avoiding unnecessary test flakiness, bump the timeout to 1800 s whenever the system has more than 128 online CPUs. Smaller systems continue to use the original 900 s limit.

---
 tests/block/005 | 5 +++++
 tests/block/008 | 5 +++++
 2 files changed, 10 insertions(+)
tests/block/005 +5 -0
index 6a58da0..0bc7625 100755
@@ -39,6 +39,11 @@ test_device() {
 	# overall test.
 	start_time=$(date +%s)
 	timeout=${TIMEOUT:=900}
+    # if CPU cores >128, then timeout×2
+    if (( $(nproc) > 128 )); then
+            timeout=$(( timeout * 2 ))
+    fi
+
 	while kill -0 $! 2>/dev/null; do
 		idx=$((RANDOM % ${#scheds[@]}))
 		_test_dev_queue_set scheduler "${scheds[$idx]}"
tests/block/008 +5 -0
index 859c0fe..d67c5b7 100755
@@ -53,6 +53,11 @@ test_device() {
 	# overall test.
 	start_time=$(date +%s)
 	timeout=${TIMEOUT:=900}
+    # if CPU cores >128, then timeout×2
+    if (( $(nproc) > 128 )); then
+            timeout=$(( timeout * 2 ))
+    fi
+
 	while sleep .2; kill -0 $! 2> /dev/null; do
 		if (( offlining && ${#offline_cpus[@]} == max_offline )); then
 			offlining=0
Signature · 1 line
2.49.0
#1 lore raw

Cc+: Johaness,

Quoted 8 lines · Li Chen

From: Li Chen <[email protected]>

The current hard-coded timeout for block/005 and 008 is 900 s. On large systems (e.g. 256 C) the test spawns one fio job per CPU and therefore issues 1 GiB of random I/O per job. Total workload scales linearly with the CPU-count, so the original 900 s window is often insufficient for high-core machines and causes false failures:

Quoted 5 lines

fio did not finish after 900 seconds!

To keep the logic simple while avoiding unnecessary test flakiness, bump the timeout to 1800 s whenever the system has more than 128 online CPUs. Smaller systems continue to use the original 900 s limit.

Hello Li, thank you for the patch, and pointing out the problem. Your idea to extend the timeout can be a solution. But I wonder we may need to extend the timeout value again when we have more CPUs in the future.

On the other hand, I can think of another idea. How about to cap the number of jobs with a specific number? According to the blktests commit 8fc7ca8300cd ("tests: use nproc to get number of CPUs for fio jobs"), the fio option --numjobs="${nproc}" in _run_fio_rand_io() was introduced for the workloads which "just want some IO". So, I think it is allowed to cap the numjobs with some number, such as 128. Based on this idea, I created the patch below. Could you try out if this approach avoids the problem on your system?

common/fio +4 -2
index 91f4b23..f4965db 100644
@@ -204,10 +204,12 @@ _fio_opts_to_min_io() {
 # Wrapper around _run_fio used if you need some I/O but don't really care much
 # about the details
 _run_fio_rand_io() {
-	local bs
+	local bs nr_jobs
 
 	bs=$(_fio_opts_to_min_io "$@") || return 1
-	_run_fio --bs="$bs" --rw=randread --norandommap --numjobs="$(nproc)" \
+	nr_jobs=$(nproc)
+	((nr_jobs > 128)) && nr_jobs=128
+	_run_fio --bs="$bs" --rw=randread --norandommap --numjobs="$nr_jobs" \
 		--name=reads --direct=1 "$@"
 }
 
author
#2 lore raw

Hi Shinichiro,

---- On Wed, 25 Jun 2025 20:20:50 +0800 Shinichiro Kawasaki <[email protected]> wrote ---

Quoted 37 lines

Cc+: Johaness,

Quoted 8 lines · Li Chen

From: Li Chen <[email protected]>

The current hard-coded timeout for block/005 and 008 is 900 s. On large systems (e.g. 256 C) the test spawns one fio job per CPU and therefore issues 1 GiB of random I/O per job. Total workload scales linearly with the CPU-count, so the original 900 s window is often insufficient for high-core machines and causes false failures:

Quoted 5 lines

fio did not finish after 900 seconds!

To keep the logic simple while avoiding unnecessary test flakiness, bump the timeout to 1800 s whenever the system has more than 128 online CPUs. Smaller systems continue to use the original 900 s limit.

Hello Li, thank you for the patch, and pointing out the problem. Your idea to extend the timeout can be a solution. But I wonder we may need to extend the timeout value again when we have more CPUs in the future.

On the other hand, I can think of another idea. How about to cap the number of jobs with a specific number? According to the blktests commit 8fc7ca8300cd ("tests: use nproc to get number of CPUs for fio jobs"), the fio option --numjobs="${nproc}" in _run_fio_rand_io() was introduced for the workloads which "just want some IO". So, I think it is allowed to cap the numjobs with some number, such as 128. Based on this idea, I created the patch below. Could you try out if this approach avoids the problem on your system?

common/fio +0 -0
index 91f4b23..f4965db 100644
@@ -204,10 +204,12 @@ _fio_opts_to_min_io() {
 # Wrapper around _run_fio used if you need some I/O but don't really care much
 # about the details

common/fio _fio_opts_to_min_io() { · line 213

Quoted 10 lines
common/fio +4 -2
 _run_fio_rand_io() {
-    local bs
+    local bs nr_jobs
 
     bs=$(_fio_opts_to_min_io "$@") || return 1
-    _run_fio --bs="$bs" --rw=randread --norandommap --numjobs="$(nproc)" \
+    nr_jobs=$(nproc)
+    ((nr_jobs > 128)) && nr_jobs=128
+    _run_fio --bs="$bs" --rw=randread --norandommap --numjobs="$nr_jobs" \
         --name=reads --direct=1 "$@"

Yes, this looks better. I'll try this patch when the machine is available, likely next week.

Regards,
Li