OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH vz10 1/3] ms/selftests/mm: increase timeout from 180 to 900 seconds
@ 2026-08-31 23:49 Eva Kurchatova
  2026-08-31 23:49 ` [Devel] [PATCH vz10 2/3] ms/selftests/mm/charge_reserved_hugetlb.sh: add waits with timeout helper Eva Kurchatova
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Eva Kurchatova @ 2026-08-31 23:49 UTC (permalink / raw)
  To: khorenko; +Cc: devel

From: Shivank Garg <shivankg@amd.com>

The mm selftests are timing out with the current 180-second limit.
Testing shows that run_vmtests.sh takes approximately 11 minutes
(664 seconds) to complete.

Increase the timeout to 900 seconds (15 minutes) to provide sufficient
buffer for the tests to complete successfully.

Link: https://lkml.kernel.org/r/20250609120606.73145-2-shivankg@amd.com
Signed-off-by: Shivank Garg <shivankg@amd.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 965f87700adbcc6d72430f524d88135027f5bba3)

https://virtuozzo.atlassian.net/browse/VSTOR-139679
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
 tools/testing/selftests/mm/settings | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mm/settings b/tools/testing/selftests/mm/settings
index a953c96aa16e..e2206265f67c 100644
--- a/tools/testing/selftests/mm/settings
+++ b/tools/testing/selftests/mm/settings
@@ -1 +1 @@
-timeout=180
+timeout=900
-- 
2.55.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Devel] [PATCH vz10 2/3] ms/selftests/mm/charge_reserved_hugetlb.sh: add waits with timeout helper
  2026-08-31 23:49 [Devel] [PATCH vz10 1/3] ms/selftests/mm: increase timeout from 180 to 900 seconds Eva Kurchatova
@ 2026-08-31 23:49 ` Eva Kurchatova
  2026-09-02 17:48   ` Konstantin Khorenko
  2026-08-31 23:49 ` [Devel] [PATCH vz10 3/3] selftests: mm: restore the executable bit on test_page_frag.sh Eva Kurchatova
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Eva Kurchatova @ 2026-08-31 23:49 UTC (permalink / raw)
  To: khorenko; +Cc: devel

From: Li Wang <liwang@redhat.com>

The hugetlb cgroup usage wait loops in charge_reserved_hugetlb.sh were
unbounded and could hang forever if the expected cgroup file value never
appears (e.g.  due to write_to_hugetlbfs in Error mapping).

=== Error log ===
  # uname -r
  6.12.0-xxx.el10.aarch64+64k

  # ls /sys/kernel/mm/hugepages/hugepages-*
  hugepages-16777216kB/  hugepages-2048kB/  hugepages-524288kB/

  #./charge_reserved_hugetlb.sh -cgroup-v2
  # -----------------------------------------
  ...
  # nr hugepages = 10
  # writing cgroup limit: 5368709120
  # writing reseravation limit: 5368709120
  ...
  # write_to_hugetlbfs: Error mapping the file: Cannot allocate memory
  # Waiting for hugetlb memory reservation to reach size 2684354560.
  # 0
  # Waiting for hugetlb memory reservation to reach size 2684354560.
  # 0
  # Waiting for hugetlb memory reservation to reach size 2684354560.
  # 0
  # Waiting for hugetlb memory reservation to reach size 2684354560.
  # 0
  # Waiting for hugetlb memory reservation to reach size 2684354560.
  # 0
  # Waiting for hugetlb memory reservation to reach size 2684354560.
  # 0
  ...

Introduce a small helper, wait_for_file_value(), and use it for:
  - waiting for reservation usage to drop to 0,
  - waiting for reservation usage to reach a given size,
  - waiting for fault usage to reach a given size.

This makes the waits consistent and adds a hard timeout (60 tries with 1s
sleep) so the test fails instead of stalling indefinitely.

Link: https://lkml.kernel.org/r/20251221122639.3168038-4-liwang@redhat.com
Signed-off-by: Li Wang <liwang@redhat.com>
Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Waiman Long <longman@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit b618876f2e7055160cc5b98b4ff5cd8917e7b49e)

https://virtuozzo.atlassian.net/browse/VSTOR-139679
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
 .../selftests/mm/charge_reserved_hugetlb.sh   | 51 +++++++++++--------
 1 file changed, 30 insertions(+), 21 deletions(-)

diff --git a/tools/testing/selftests/mm/charge_reserved_hugetlb.sh b/tools/testing/selftests/mm/charge_reserved_hugetlb.sh
index e1fe16bcbbe8..912fc6ec53ab 100755
--- a/tools/testing/selftests/mm/charge_reserved_hugetlb.sh
+++ b/tools/testing/selftests/mm/charge_reserved_hugetlb.sh
@@ -100,7 +100,7 @@ function setup_cgroup() {
   echo writing cgroup limit: "$cgroup_limit"
   echo "$cgroup_limit" >$cgroup_path/$name/hugetlb.${MB}MB.$fault_limit_file
 
-  echo writing reseravation limit: "$reservation_limit"
+  echo writing reservation limit: "$reservation_limit"
   echo "$reservation_limit" > \
     $cgroup_path/$name/hugetlb.${MB}MB.$reservation_limit_file
 
@@ -112,41 +112,50 @@ function setup_cgroup() {
   fi
 }
 
+function wait_for_file_value() {
+  local path="$1"
+  local expect="$2"
+  local max_tries=60
+
+  if [[ ! -r "$path" ]]; then
+    echo "ERROR: cannot read '$path', missing or permission denied"
+    return 1
+  fi
+
+  for ((i=1; i<=max_tries; i++)); do
+    local cur="$(cat "$path")"
+    if [[ "$cur" == "$expect" ]]; then
+      return 0
+    fi
+    echo "Waiting for $path to become '$expect' (current: '$cur') (try $i/$max_tries)"
+    sleep 1
+  done
+
+  echo "ERROR: timeout waiting for $path to become '$expect'"
+  return 1
+}
+
 function wait_for_hugetlb_memory_to_get_depleted() {
   local cgroup="$1"
   local path="$cgroup_path/$cgroup/hugetlb.${MB}MB.$reservation_usage_file"
-  # Wait for hugetlbfs memory to get depleted.
-  while [ $(cat $path) != 0 ]; do
-    echo Waiting for hugetlb memory to get depleted.
-    cat $path
-    sleep 0.5
-  done
+
+  wait_for_file_value "$path" "0"
 }
 
 function wait_for_hugetlb_memory_to_get_reserved() {
   local cgroup="$1"
   local size="$2"
-
   local path="$cgroup_path/$cgroup/hugetlb.${MB}MB.$reservation_usage_file"
-  # Wait for hugetlbfs memory to get written.
-  while [ $(cat $path) != $size ]; do
-    echo Waiting for hugetlb memory reservation to reach size $size.
-    cat $path
-    sleep 0.5
-  done
+
+  wait_for_file_value "$path" "$size"
 }
 
 function wait_for_hugetlb_memory_to_get_written() {
   local cgroup="$1"
   local size="$2"
-
   local path="$cgroup_path/$cgroup/hugetlb.${MB}MB.$fault_usage_file"
-  # Wait for hugetlbfs memory to get written.
-  while [ $(cat $path) != $size ]; do
-    echo Waiting for hugetlb memory to reach size $size.
-    cat $path
-    sleep 0.5
-  done
+
+  wait_for_file_value "$path" "$size"
 }
 
 function write_hugetlbfs_and_get_usage() {
-- 
2.55.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Devel] [PATCH vz10 3/3] selftests: mm: restore the executable bit on test_page_frag.sh
  2026-08-31 23:49 [Devel] [PATCH vz10 1/3] ms/selftests/mm: increase timeout from 180 to 900 seconds Eva Kurchatova
  2026-08-31 23:49 ` [Devel] [PATCH vz10 2/3] ms/selftests/mm/charge_reserved_hugetlb.sh: add waits with timeout helper Eva Kurchatova
@ 2026-08-31 23:49 ` Eva Kurchatova
  2026-09-02 17:48   ` Konstantin Khorenko
  2026-09-02 17:48 ` [Devel] [PATCH vz10 1/3] ms/selftests/mm: increase timeout from 180 to 900 seconds Konstantin Khorenko
  2026-09-02 17:51 ` Konstantin Khorenko
  3 siblings, 1 reply; 7+ messages in thread
From: Eva Kurchatova @ 2026-08-31 23:49 UTC (permalink / raw)
  To: khorenko; +Cc: devel

run_vmtests.sh runs the script directly:

  CATEGORY="page_frag" run_test ./test_page_frag.sh smoke

which needs the executable bit. The file is 100755 upstream but 100644
in this tree, so the three page_frag cases fail before running:

  not ok 58 test_page_frag.sh smoke # exit=126

exit 126 is the shell refusing a file it may not execute. Restore the
bit. Upstream already has it, so this applies to this tree only.

https://virtuozzo.atlassian.net/browse/VSTOR-139679
Feature: fix vz selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
 tools/testing/selftests/mm/test_page_frag.sh | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 tools/testing/selftests/mm/test_page_frag.sh

diff --git a/tools/testing/selftests/mm/test_page_frag.sh b/tools/testing/selftests/mm/test_page_frag.sh
old mode 100644
new mode 100755
-- 
2.55.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Devel] [PATCH vz10 1/3] ms/selftests/mm: increase timeout from 180 to 900 seconds
  2026-08-31 23:49 [Devel] [PATCH vz10 1/3] ms/selftests/mm: increase timeout from 180 to 900 seconds Eva Kurchatova
  2026-08-31 23:49 ` [Devel] [PATCH vz10 2/3] ms/selftests/mm/charge_reserved_hugetlb.sh: add waits with timeout helper Eva Kurchatova
  2026-08-31 23:49 ` [Devel] [PATCH vz10 3/3] selftests: mm: restore the executable bit on test_page_frag.sh Eva Kurchatova
@ 2026-09-02 17:48 ` Konstantin Khorenko
  2026-09-02 17:51 ` Konstantin Khorenko
  3 siblings, 0 replies; 7+ messages in thread
From: Konstantin Khorenko @ 2026-09-02 17:48 UTC (permalink / raw)
  To: Eva Kurchatova; +Cc: devel

On Tue, 01 Sep 2026 02:49:20 +0300, Eva Kurchatova <eva.kurchatova@virtuozzo.com> wrote:
> The mm selftests are timing out with the current 180-second limit.
> Testing shows that run_vmtests.sh takes approximately 11 minutes
> (664 seconds) to complete.
> 
> Increase the timeout to 900 seconds (15 minutes) to provide sufficient
> buffer for the tests to complete successfully.
> 
> [...]

Reviewed-by: Konstantin Khorenko <khorenko@virtuozzo.com>

-- 
Konstantin Khorenko <khorenko@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Devel] [PATCH vz10 3/3] selftests: mm: restore the executable bit on test_page_frag.sh
  2026-08-31 23:49 ` [Devel] [PATCH vz10 3/3] selftests: mm: restore the executable bit on test_page_frag.sh Eva Kurchatova
@ 2026-09-02 17:48   ` Konstantin Khorenko
  0 siblings, 0 replies; 7+ messages in thread
From: Konstantin Khorenko @ 2026-09-02 17:48 UTC (permalink / raw)
  To: Eva Kurchatova; +Cc: devel

On Tue, 01 Sep 2026 02:49:22 +0300, Eva Kurchatova <eva.kurchatova@virtuozzo.com> wrote:
> run_vmtests.sh runs the script directly:
> 
>   CATEGORY="page_frag" run_test ./test_page_frag.sh smoke
> 
> which needs the executable bit. The file is 100755 upstream but 100644
> in this tree, so the three page_frag cases fail before running:
> 
> [...]

Reviewed-by: Konstantin Khorenko <khorenko@virtuozzo.com>

-- 
Konstantin Khorenko <khorenko@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Devel] [PATCH vz10 2/3] ms/selftests/mm/charge_reserved_hugetlb.sh: add waits with timeout helper
  2026-08-31 23:49 ` [Devel] [PATCH vz10 2/3] ms/selftests/mm/charge_reserved_hugetlb.sh: add waits with timeout helper Eva Kurchatova
@ 2026-09-02 17:48   ` Konstantin Khorenko
  0 siblings, 0 replies; 7+ messages in thread
From: Konstantin Khorenko @ 2026-09-02 17:48 UTC (permalink / raw)
  To: Eva Kurchatova; +Cc: devel

On Tue, 01 Sep 2026 02:49:21 +0300, Eva Kurchatova <eva.kurchatova@virtuozzo.com> wrote:
> The hugetlb cgroup usage wait loops in charge_reserved_hugetlb.sh were
> unbounded and could hang forever if the expected cgroup file value never
> appears (e.g.  due to write_to_hugetlbfs in Error mapping).
> 
> === Error log ===
>   # uname -r
>   6.12.0-xxx.el10.aarch64+64k
> 
> [...]

Reviewed-by: Konstantin Khorenko <khorenko@virtuozzo.com>

-- 
Konstantin Khorenko <khorenko@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Devel] [PATCH vz10 1/3] ms/selftests/mm: increase timeout from 180 to 900 seconds
  2026-08-31 23:49 [Devel] [PATCH vz10 1/3] ms/selftests/mm: increase timeout from 180 to 900 seconds Eva Kurchatova
                   ` (2 preceding siblings ...)
  2026-09-02 17:48 ` [Devel] [PATCH vz10 1/3] ms/selftests/mm: increase timeout from 180 to 900 seconds Konstantin Khorenko
@ 2026-09-02 17:51 ` Konstantin Khorenko
  3 siblings, 0 replies; 7+ messages in thread
From: Konstantin Khorenko @ 2026-09-02 17:51 UTC (permalink / raw)
  To: Eva Kurchatova; +Cc: devel

On Tue, 01 Sep 2026 02:49:20 +0300, Eva Kurchatova wrote:
> ms/selftests/mm: increase timeout from 180 to 900 seconds

Applied to branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz, after rh10-6.12.0-211.39.1.16.12.vz10, thanks!

[1/3] ms/selftests/mm: increase timeout from 180 to 900 seconds
      https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/cbd272e78fdf
[2/3] ms/selftests/mm/charge_reserved_hugetlb.sh: add waits with timeout helper
      https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/a73ae09842ea
[3/3] selftests: mm: restore the executable bit on test_page_frag.sh
      https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/307e9d5e47a0

-- 
Konstantin Khorenko <khorenko@virtuozzo.com>

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-02 17:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-31 23:49 [Devel] [PATCH vz10 1/3] ms/selftests/mm: increase timeout from 180 to 900 seconds Eva Kurchatova
2026-08-31 23:49 ` [Devel] [PATCH vz10 2/3] ms/selftests/mm/charge_reserved_hugetlb.sh: add waits with timeout helper Eva Kurchatova
2026-09-02 17:48   ` Konstantin Khorenko
2026-08-31 23:49 ` [Devel] [PATCH vz10 3/3] selftests: mm: restore the executable bit on test_page_frag.sh Eva Kurchatova
2026-09-02 17:48   ` Konstantin Khorenko
2026-09-02 17:48 ` [Devel] [PATCH vz10 1/3] ms/selftests/mm: increase timeout from 180 to 900 seconds Konstantin Khorenko
2026-09-02 17:51 ` Konstantin Khorenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox