On Fri, May 25, 2012 at 2:12 AM, Jan Stancek <[email protected]> wrote:
>
> Some setups can lack memory on arbitrary nodes, use only nodes
> returned by get_mempolicy(..., MPOL_F_MEMS_ALLOWED).
>
> Signed-off-by: Jan Stancek <[email protected]>
> ---
>  .../syscalls/move_pages/move_pages_support.c       |   74 
> ++++++++++++++++----
>  .../syscalls/move_pages/move_pages_support.h       |    1 +
>  2 files changed, 62 insertions(+), 13 deletions(-)

+       if (syscall(__NR_get_mempolicy, NULL, allowed_nodemask->maskp,
+               allowed_nodemask->size, 0, MPOL_F_MEMS_ALLOWED) < 0)
+               tst_resm(TFAIL|TERRNO, "get_mempolicy: MPOL_F_MEMS_ALLOWED");
+

Would tst_brkm be better here? Also, what happens in the negative case
(HAVE_NUMA_H is not defined)? Wouldn't that segfault accessing random
memory or something along those lines?

I think it would be better to design the API (get_allowed_nodes) to
return an integer value to denote success or failure, then test for
that in main and report errors there.

Thanks!
-Garrett

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to