Re: [PATCH] tests/throtl: add a new test 007

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





在 2025/6/13 10:52, Yu Kuai 写道:
Hi,

在 2025/06/13 10:35, Zizhi Wo 写道:
From: Zizhi Wo <wozizhi@xxxxxxxxxx>

Test change config while IO is throttled, for IO splitting scenario.
Regression test for commit d1ba22ab2bec ("blk-throttle: Prevents the bps
restricted io from entering the bps queue again").

Signed-off-by: Zizhi Wo <wozizhi@xxxxxxxxxx>
---
  tests/throtl/007     | 41 +++++++++++++++++++++++++++++++++++++++++
  tests/throtl/007.out |  6 ++++++
  2 files changed, 47 insertions(+)
  create mode 100755 tests/throtl/007
  create mode 100644 tests/throtl/007.out

diff --git a/tests/throtl/007 b/tests/throtl/007
new file mode 100755
index 0000000..98ba4ea
--- /dev/null
+++ b/tests/throtl/007
@@ -0,0 +1,41 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2025 Zizhi Wo
+#
+# Test change config while IO is throttled, for IO splitting scenario.

This test do not change config while IO is throttled, it's iops limit
over io split.

Oh, there was something wrong with my understanding before..


+# Regression test for commit d1ba22ab2bec ("blk-throttle: Prevents the bps
+# restricted io from entering the bps queue again")
+
+. tests/throtl/rc
+
+DESCRIPTION="bps limit with iops limit over io split"
+QUICK=1
+
+test() {
+    echo "Running ${TEST_NAME}"
+
+    if ! _set_up_throtl max_sectors=8; then
+        return 1;
+    fi

And this should be updated, please take a look at
60fa2e3 ("throtl/{002,003}: update max_sectors setting").


Yes, I didn't notice this. I will modify it.

Thanks,
Zizhi Wo


Thanks,
Kuai

+
+    local bps_limit=$((1024 * 1024))
+    local iops_limit=1000000
+
+    # just set bps limit first
+    _throtl_set_limits wbps=$bps_limit
+    _throtl_test_io write 1M 1 &
+    _throtl_test_io write 1M 1 &
+    wait
+    _throtl_remove_limits
+
+    # set the same bps limit and a high iops limit
+    # should behave the same as no iops limit
+    _throtl_set_limits wbps=$bps_limit wiops=$iops_limit
+    _throtl_test_io write 1M 1 &
+    _throtl_test_io write 1M 1 &
+    wait
+    _throtl_remove_limits
+
+    _clean_up_throtl
+    echo "Test complete"
+}
diff --git a/tests/throtl/007.out b/tests/throtl/007.out
new file mode 100644
index 0000000..d28cdef
--- /dev/null
+++ b/tests/throtl/007.out
@@ -0,0 +1,6 @@
+Running throtl/007
+1
+2
+1
+2
+Test complete






[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux