<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 Fri, Jul 30, 2021 at 6:35 PM Jan Stancek <<a href="mailto:jstancek@redhat.com">jstancek@redhat.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"><div dir="ltr"><div dir="ltr"><div style="font-family:monospace"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 30, 2021 at 10:03 AM Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.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"><div dir="ltr"><div dir="ltr"><div style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 29, 2021 at 10:20 PM Jan Stancek <<a href="mailto:jstancek@redhat.com" target="_blank">jstancek@redhat.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"><div dir="ltr"><div dir="ltr"><div style="font-family:monospace"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 29, 2021 at 3:25 PM Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.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">Signed-off-by: Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>><br>
---<br>
testcases/kernel/syscalls/mbind/mbind01.c | 25 ++++++++++++++++++++---<br>
1 file changed, 22 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c<br>
index d2cf13c8f..b5c1e948d 100644<br>
--- a/testcases/kernel/syscalls/mbind/mbind01.c<br>
+++ b/testcases/kernel/syscalls/mbind/mbind01.c<br>
@@ -34,7 +34,7 @@ static struct bitmask *nodemask, *getnodemask, *empty_nodemask;<br>
static void test_default(unsigned int i, char *p);<br>
static void test_none(unsigned int i, char *p);<br>
static void test_invalid_nodemask(unsigned int i, char *p);<br>
-static void check_policy_pref_no_target(int);<br>
+static void check_policy_pref_or_local(int);<br>
<br>
struct test_case {<br>
int policy;<br>
@@ -92,7 +92,7 @@ static struct test_case tcase[] = {<br>
.ret = 0,<br>
.err = 0,<br>
.test = test_none,<br>
- .check_policy = check_policy_pref_no_target,<br>
+ .check_policy = check_policy_pref_or_local,<br>
},<br>
{<br>
POLICY_DESC(MPOL_PREFERRED),<br>
@@ -101,6 +101,20 @@ static struct test_case tcase[] = {<br>
.test = test_default,<br>
.exp_nodemask = &nodemask,<br>
},<br>
+ {<br>
+ POLICY_DESC(MPOL_LOCAL),<br>
+ .ret = 0,<br>
+ .err = 0,<br>
+ .test = test_none,<br>
+ .exp_nodemask = &empty_nodemask,<br>
+ .check_policy = check_policy_pref_or_local,<br></blockquote><div><br></div><div><div style="font-family:monospace">This is a bit more permissive, it allows for MPOL_LOCAL to return also MPOL_PREFERRED.</div><div style="font-family:monospace">
</div><div style="font-family:monospace">Shouldn't that still be treated as error?</div></div></div></div></blockquote><div><br></div><div><div style="font-size:small">To strictly this should be an error.</div><div style="font-size:small"><br></div></div><span class="gmail_default" style="font-size:small">But </span>I <span class="gmail_default" style="font-size:small">slightly think</span> that<span class="gmail_default" style="font-size:small"> it's</span> acceptable <span class="gmail_default" style="font-size:small">to</span> get 'MPOL_PREFERRED'<span class="gmail_default" style="font-size:small"> </span>on<span class="gmail_default" style="font-size:small"> the old</span></div><div class="gmail_quote"><span class="gmail_default" style="font-size:small">kernel (i.e. 4.18</span><span class="gmail_default" style="font-size:small">.0, v5.13) </span><span class="gmail_default">because</span> 'MPOL_LOCAL' is not treated as a real policy.</div><div class="gmail_quote"><div style="font-size:small">And the situation exists for quite a long time.</div></div></div></blockquote><div><br></div><div><div style="font-family:monospace">You're right, on older kernel it failed in similar way for MPOL_LOCAL</div><div style="font-family:monospace">as it failed for MPOL_PREFERRED on latest one.</div></div></div></div></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Or, If we want something more precise, just cancel the</div><div class="gmail_default" style="font-size:small">check_policy_pref_or_local on kernel >= 5.14.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Is this sound better?</div><div><br></div><div><div class="gmail_default" style="font-size:small">- if ((tst_kvercmp(3, 8, 0)) < 0 && (tc->policy == MPOL_LOCAL)) {</div>- tst_res(TCONF, "%s is not supported", tst_mempolicy_mode_name(tc->policy));<br>- return;</div><div><br>+ if (tc->policy == MPOL_LOCAL) {<br>+ if ((tst_kvercmp(3, 8, 0)) < 0) {<br>+ tst_res(TCONF, "%s is not supported",<span class="gmail_default" style="font-size:small"> </span>tst_mempolicy_mode_name(tc->policy));<br>+ return;<br>+ }<br>+<br>+ if ((tst_kvercmp(5, 14, 0)) >= 0)<br>+ tc->check_policy = NULL;<br><div class="gmail_default" style="font-size:small"></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"><div dir="ltr"><div class="gmail_quote"><div><div style="font-family:monospace"><br></div><div style="font-family:monospace">Acked-by: Jan Stancek <<a href="mailto:jstancek@redhat.com" target="_blank">jstancek@redhat.com</a>></div><div style="font-family:monospace"><br></div></div></div></div>
</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>