<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 8, 2022 at 10:04 PM Richard Palethorpe via ltp <<a href="mailto:ltp@lists.linux.it">ltp@lists.linux.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">At first glance this test looks the same as memcontrol03. However<br>
there are some significant changes which complicate combining the two.<br>
<br>
Signed-off-by: Richard Palethorpe <<a href="mailto:rpalethorpe@suse.com" target="_blank">rpalethorpe@suse.com</a>><br>
---<br>
runtest/controllers | 1 +<br>
testcases/kernel/controllers/memcg/.gitignore | 1 +<br>
.../kernel/controllers/memcg/memcontrol04.c | 228 ++++++++++++++++++<br>
3 files changed, 230 insertions(+)<br>
create mode 100644 testcases/kernel/controllers/memcg/memcontrol04.c<br>
<br>
diff --git a/runtest/controllers b/runtest/controllers<br>
index 4a6f919af..3108a2561 100644<br>
--- a/runtest/controllers<br>
+++ b/runtest/controllers<br>
@@ -20,6 +20,7 @@ memcg_control memcg_control_test.sh<br>
memcontrol01 memcontrol01<br>
memcontrol02 memcontrol02<br>
memcontrol03 memcontrol03<br>
+memcontrol04 memcontrol04<br>
<br>
cgroup_fj_function_debug cgroup_fj_function.sh debug<br>
cgroup_fj_function_cpuset cgroup_fj_function.sh cpuset<br>
diff --git a/testcases/kernel/controllers/memcg/.gitignore b/testcases/kernel/controllers/memcg/.gitignore<br>
index 49df1582c..3883cede6 100644<br>
--- a/testcases/kernel/controllers/memcg/.gitignore<br>
+++ b/testcases/kernel/controllers/memcg/.gitignore<br>
@@ -8,3 +8,4 @@<br>
memcontrol01<br>
memcontrol02<br>
memcontrol03<br>
+memcontrol04<br>
diff --git a/testcases/kernel/controllers/memcg/memcontrol04.c b/testcases/kernel/controllers/memcg/memcontrol04.c<br>
new file mode 100644<br>
index 000000000..cdfeff4a4<br>
--- /dev/null<br>
+++ b/testcases/kernel/controllers/memcg/memcontrol04.c<br>
@@ -0,0 +1,228 @@<br>
+// SPDX-License-Identifier: GPL-2.0<br>
+/*\<br>
+ *<br>
+ * [Description]<br>
+ *<br>
+ * Conversion of the forth kself test in cgroup/test_memcontrol.c.<br>
+ *<br>
+ * Original description:<br>
+ * "First, this test creates the following hierarchy:<br>
+ * A memory.low = 50M, memory.max = 200M<br>
+ * A/B memory.low = 50M, memory.current = 50M<br>
+ * A/B/C memory.low = 75M, memory.current = 50M<br>
+ * A/B/D memory.low = 25M, memory.current = 50M<br>
+ * A/B/E memory.low = 500M, memory.current = 0<br>
+ * A/B/F memory.low = 0, memory.current = 50M<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">This test has a high <span style="color:rgb(51,51,51);font-size:14px">repetition</span> with memcontrol03, I'm just</div><div class="gmail_default" style="font-size:small">wondering if any possibility to merge together by defining a </div><div class="gmail_default" style="font-size:small">struct tcase?</div><div class="gmail_default" style="font-size:small"><br></div>static struct tcase {<br> char *<span class="gmail_default" style="font-size:small">ctrl_file</span>;<br>} tcases[] = {<br> {"memory.min"},<br> {"memory.low"}<br>};<br><div class="gmail_default" style="font-size:small"></div></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>