From: Zhang X. <zha...@cn...> - 2009-09-02 05:39:55
|
I tested ltp mbind case and found the case06 failed. In mbind manual, it says "If the nodemask and maxnode arguments specify the empty set, then the memory is allocated on the node of the CPU that triggered the allocation." In case06, when tc->policy is MPOL_PREFERRED and tc->from_node is NONE, the getnodemask which is get by get_mempolicy() refer to the node of the CPU that triggered the allocation. But the nodemask is zero.(It is not used by mbind(), mbind() used "NULL".) So in this case, the cmp_ok should only compare the policy. Signed-off-by: Zhang Xiliang <zha...@cn...> --- testcases/kernel/syscalls/mbind/mbind01.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c index 94c2dd0..446fdaf 100644 --- a/testcases/kernel/syscalls/mbind/mbind01.c +++ b/testcases/kernel/syscalls/mbind/mbind01.c @@ -305,7 +305,10 @@ static int do_test(struct test_case *tc) { // When policy equals MPOL_DEFAULT, then get_mempolicy not return node if (tc->policy == MPOL_DEFAULT) nodemask_zero(&nodemask); - cmp_ok = ((tc->policy == policy) && nodemask_equal(&nodemask,&getnodemask)); + if ((tc->policy == MPOL_PREFERRED) && (tc->from_node == NONE)) + cmp_ok = (tc->policy == policy); + else + cmp_ok = ((tc->policy == policy) && nodemask_equal(&nodemask,&getnodemask)); if (opt_debug) { nodemask_dump("nodemask Expect:", &nodemask); nodemask_dump("nodemask Result:", &getnodemask); |