<div dir="ltr"><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 Thu, May 9, 2019 at 2:45 PM Balamuruhan S <<a href="mailto:bala24@linux.vnet.ibm.com" target="_blank">bala24@linux.vnet.ibm.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">On Wed, May 08, 2019 at 04:44:47PM +0800, Li Wang wrote:<br>
> For some ppc64le systems, it has non-continuous numa nodes in<br>
> hardware configuration. So we're hitting the below warnings while<br>
> running set_mempolicy tests on that. To fix this issue, let's just<br>
> remove restrictions on numa node-id in get_mempolicy().<br>
> <br>
> Error Log<br>
> ---------<br>
> tst_test.c:1096: INFO: Timeout per run is 0h 50m 00s<br>
> tst_numa.c:190: INFO: Found 2 NUMA memory nodes<br>
> set_mempolicy01.c:63: PASS: set_mempolicy(MPOL_BIND) node 0<br>
> tst_numa.c:26: INFO: Node 0 allocated 16 pages<br>
> tst_numa.c:26: INFO: Node 8 allocated 0 pages<br>
> set_mempolicy01.c:82: PASS: child: Node 0 allocated 16<br>
> set_mempolicy01.c:63: PASS: set_mempolicy(MPOL_BIND) node 8<br>
> tst_numa.c:92: WARN: get_mempolicy(...) returned invalid node 8<br>
> tst_numa.c:92: WARN: get_mempolicy(...) returned invalid node 8<br>
> tst_numa.c:92: WARN: get_mempolicy(...) returned invalid node 8<br>
> ...<br>
> tst_numa.c:26: INFO: Node 0 allocated 0 pages<br>
> tst_numa.c:26: INFO: Node 8 allocated 0 pages<br>
> set_mempolicy01.c:86: FAIL: child: Node 8 allocated 0, expected 16<br>
> <br>
> lscpu<br>
> -----<br>
> Architecture: ppc64le<br>
> ...<br>
> CPU(s): 128<br>
> Core(s) per socket: 16<br>
> Socket(s): 2<br>
> NUMA node(s): 2<br>
> Model name: POWER9, altivec supported<br>
> ...<br>
> NUMA node0 CPU(s): 0-63<br>
> NUMA node8 CPU(s): 64-127<br>
> <br>
> Signed-off-by: Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>><br>
> Cc: Cyril Hrubis <<a href="mailto:chrubis@suse.cz" target="_blank">chrubis@suse.cz</a>><br>
> ---<br>
> libs/libltpnuma/tst_numa.c | 5 +++--<br>
> 1 file changed, 3 insertions(+), 2 deletions(-)<br>
> <br>
> diff --git a/libs/libltpnuma/tst_numa.c b/libs/libltpnuma/tst_numa.c<br>
> index 0ba6daf39..56c8640ff 100644<br>
> --- a/libs/libltpnuma/tst_numa.c<br>
> +++ b/libs/libltpnuma/tst_numa.c<br>
> @@ -88,8 +88,9 @@ void tst_nodemap_count_pages(struct tst_nodemap *nodes,<br>
> if (ret < 0)<br>
> tst_brk(TBROK | TERRNO, "get_mempolicy() failed");<br>
> <br>
> - if (node < 0 || (unsigned int)node >= nodes->cnt) {<br>
> - tst_res(TWARN, "get_mempolicy(...) returned invalid node %i\n", node);<br>
> + if (node < 0) {<br>
<br>
It is better to have check for powerpc and remove restriction as it will<br>
still hold good for other arch.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">If the non-continuous numa nodes only appear in ppc machine, that should be necessary to check arch before removing the restriction.</div><br></div><div class="gmail_default" style="font-size:small">then the patch probably like:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default">--- a/libs/libltpnuma/tst_numa.c</div><div class="gmail_default">+++ b/libs/libltpnuma/tst_numa.c</div><div class="gmail_default">@@ -88,7 +88,11 @@ void tst_nodemap_count_pages(struct tst_nodemap *nodes,</div><div class="gmail_default"> if (ret < 0)</div><div class="gmail_default"> tst_brk(TBROK | TERRNO, "get_mempolicy() failed");</div><div class="gmail_default"> </div><div class="gmail_default">+#if defined (__powerpc64__) || (__powerpc__)</div><div class="gmail_default">+ if (node < 0) {</div><div class="gmail_default">+#elif</div><div class="gmail_default"> if (node < 0 || (unsigned int)node >= nodes->cnt) {</div><div class="gmail_default">+#endif</div><div class="gmail_default"> tst_res(TWARN, "get_mempolicy(...) returned invalid node %i\n", node);</div><div class="gmail_default"> continue;</div><div class="gmail_default"> }</div><div class="gmail_default" style="font-size:small"></div></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-5166788601101912600gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div></div>