834f04
From 14d044da23d6f2fa03066aedcc2600a479c1f731 Mon Sep 17 00:00:00 2001
834f04
From: Anita Zhang <the.anitazha@gmail.com>
834f04
Date: Wed, 2 Dec 2020 14:41:38 -0800
834f04
Subject: [PATCH] test: fix TEST-56-OOMD thresholds for linux 5.9 changes
834f04
834f04
Fixes #17533
834f04
834f04
The memory pressure values of the units in TEST-56-OOMD seemed to be a
834f04
lot lower after updating to linux 5.9. This is likely due to a fix from
834f04
https://github.com/torvalds/linux/commit/e22c6ed90aa91abc08f107344428ebb8c2629e98.
834f04
834f04
To account for this, I lowered memory.high on testbloat.service to
834f04
throttle it even more. This was enough to generate the 50%+ value to trigger
834f04
oomd for the test, but as an extra precaution I also lowered the oomd
834f04
threshold to 1% so it's certain to try and kill testbloat.service.
834f04
---
834f04
 test/units/testsuite-56-testbloat.service | 6 +++---
834f04
 test/units/testsuite-56-workload.slice    | 2 +-
834f04
 test/units/testsuite-56.sh                | 2 +-
834f04
 3 files changed, 5 insertions(+), 5 deletions(-)
834f04
834f04
diff --git a/test/units/testsuite-56-testbloat.service b/test/units/testsuite-56-testbloat.service
834f04
index 40cf5a9f36f..6163aae1dba 100644
834f04
--- a/test/units/testsuite-56-testbloat.service
834f04
+++ b/test/units/testsuite-56-testbloat.service
834f04
@@ -2,8 +2,8 @@
834f04
 Description=Create a lot of memory pressure
834f04
 
834f04
 [Service]
834f04
-# A very small memory.high will cause the script (trying to use a lot of memory)
834f04
-# to throttle and be put under heavy pressure
834f04
-MemoryHigh=2M
834f04
+# A VERY small memory.high will cause the script (trying to use a lot of memory)
834f04
+# to throttle and be put under heavy pressure.
834f04
+MemoryHigh=1M
834f04
 Slice=testsuite-56-workload.slice
834f04
 ExecStart=/usr/lib/systemd/tests/testdata/units/testsuite-56-slowgrowth.sh
834f04
diff --git a/test/units/testsuite-56-workload.slice b/test/units/testsuite-56-workload.slice
834f04
index 3d542ec2bae..45b04914c63 100644
834f04
--- a/test/units/testsuite-56-workload.slice
834f04
+++ b/test/units/testsuite-56-workload.slice
834f04
@@ -7,4 +7,4 @@ MemoryAccounting=true
834f04
 IOAccounting=true
834f04
 TasksAccounting=true
834f04
 ManagedOOMMemoryPressure=kill
834f04
-ManagedOOMMemoryPressureLimitPercent=50%
834f04
+ManagedOOMMemoryPressureLimitPercent=1%
834f04
diff --git a/test/units/testsuite-56.sh b/test/units/testsuite-56.sh
834f04
index 37d62d943c0..1846248855b 100755
834f04
--- a/test/units/testsuite-56.sh
834f04
+++ b/test/units/testsuite-56.sh
834f04
@@ -19,7 +19,7 @@ systemctl start testsuite-56-testchill.service
834f04
 
834f04
 # Verify systemd-oomd is monitoring the expected units
834f04
 oomctl | grep "/testsuite-56-workload.slice"
834f04
-oomctl | grep "50%"
834f04
+oomctl | grep "1%"
834f04
 
834f04
 # systemd-oomd watches for elevated pressure for 30 seconds before acting.
834f04
 # It can take time to build up pressure so either wait 5 minutes or for the service to fail.