<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Richard,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 16, 2020 at 4:59 PM Richard Palethorpe <<a href="mailto:rpalethorpe@suse.com">rpalethorpe@suse.com</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">Setting the swap limit is unnecessary for this test. By default it<br>
appears to be set to some large value which is OK. Setting it may fail<br>
for reasons unrelated to the test's purpose making the test less<br>
reliable.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Generally, this is right. And if the <span class="gmail_default">'</span>memory.limit_in_bytes' has been set</div><div class="gmail_default">successfully, that means the default value of 'memory.memsw.limit_in_bytes'</div><div class="gmail_default">is bigger than or equal to it.</div><div class="gmail_default">(an invalid argument error will occur if not like this)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">But in this madvise06, set 'memory.memsw.limit_in_bytes' will safer to test.</div><div class="gmail_default" style="font-size:small"><br></div>The reason is to make sure memsw.limit_in_bytes' is bigger(twifold) than<div class="gmail_default" style="font-size:small"><span class="gmail_default">'</span>memory.limit_in_bytes' otherwise it can't be finished as we expected.</div><div class="gmail_default" style="font-size:small">(madvise06 will be stuck when memsw.limit_in_bytes < 2 * memory.limit_in_bytes)</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Signed-off-by: Richard Palethorpe <<a href="mailto:rpalethorpe@suse.com" target="_blank">rpalethorpe@suse.com</a>><br>
---<br>
<br>
I should not have included this in the first update to the test. It<br>
appears that it fails with EACCES on at least one configuration, where<br>
the test ran previously. Also it could fail with EBUSY in theory.<br>
<br>
I don't know why limit_in_bytes can be set, but memsw.limit_in_bytes<br>
results in EACCES. This is interesting, however should be the focus of<br>
a different test IMO.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">This sounds like a cgroup issue or related configuration caused.</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
testcases/kernel/syscalls/madvise/madvise06.c | 3 ---<br>
1 file changed, 3 deletions(-)<br>
<br>
diff --git a/testcases/kernel/syscalls/madvise/madvise06.c b/testcases/kernel/syscalls/madvise/madvise06.c<br>
index 817faae39..2ba2bac6f 100644<br>
--- a/testcases/kernel/syscalls/madvise/madvise06.c<br>
+++ b/testcases/kernel/syscalls/madvise/madvise06.c<br>
@@ -46,7 +46,6 @@<br>
<br>
#define CHUNK_SZ (400*1024*1024L)<br>
#define MEM_LIMIT (CHUNK_SZ / 2)<br>
-#define MEMSW_LIMIT (2 * CHUNK_SZ)<br>
#define PASS_THRESHOLD (CHUNK_SZ / 4)<br>
#define PASS_THRESHOLD_KB (PASS_THRESHOLD / 1024)<br>
<br>
@@ -124,8 +123,6 @@ static void setup(void)<br>
SAFE_FILE_PRINTF("/proc/self/oom_score_adj", "%d", -1000);<br>
SAFE_FILE_PRINTF(MNT_NAME"/"GROUP_NAME"/<span class="gmail_default" style="font-size:small"></span>memory.limit_in_bytes", "%ld\n",<br>
MEM_LIMIT);<br>
- SAFE_FILE_PRINTF(MNT_NAME"/"GROUP_NAME"/<span class="gmail_default" style="font-size:small"></span>memory.memsw.limit_in_bytes", "%ld\n",<br>
- MEMSW_LIMIT);<br>
SAFE_FILE_PRINTF(MNT_NAME"/"GROUP_NAME"/memory.swappiness", "60");<br>
SAFE_FILE_PRINTF(MNT_NAME"/"GROUP_NAME"/tasks", "%d\n", getpid());<br>
<br>
-- <br>
2.29.1<br>
<br>
</blockquote></div><br clear="all"><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>