Skip to contentSkip to conversation

block/038: cap submit_queues to min(4, nproc) to fix failure on low CPU machines

PATCH New gomid4497 1 participant 1 message Apr 7 Block layer

lore
Share & tools
lore

gomid4497

author
#0 lore raw

PATCH 1/1 block/038: cap submit_queues to min(4, nproc) to fix failure on low CPU machines

---
 tests/block/038 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/block/038 +2 -1
index 56272be..5cbbd07 100755
@@ -28,9 +28,10 @@ null_blk_power_loop() {
 
 null_blk_submit_queues_loop() {
 	local nullb="$1"
+	local queues=$(( $(nproc) < 4 ? $(nproc) : 4 ))
 	for ((i = 1; i <= 200; i++)); do
 		echo 1 > "/sys/kernel/config/nullb/${nullb}/submit_queues"
-		echo 4 > "/sys/kernel/config/nullb/${nullb}/submit_queues"
+		echo ${queues} > "/sys/kernel/config/nullb/${nullb}/submit_queues"
 	done
 }
 
Signature · 1 line
2.50.1 (Apple Git-155)