Re: [mm/mempolicy] 7463fff037: ltp.mbind01.fail

From: Michal Hocko
Date: Mon Jun 07 2021 - 04:10:12 EST


On Mon 07-06-21 15:48:15, kernel test robot wrote:
> mbind01.c:169: TINFO: case MPOL_PREFERRED (no target)
> mbind01.c:188: TFAIL: Wrong policy: 1, expected: 4

AFAIU this points to
static void test_none(unsigned int i, char *p)
{
struct test_case *tc = &tcase[i];

TEST(mbind(p, MEM_LENGTH, tc->policy, NULL, 0, tc->flags));
}

So it calls MPOL_PREFERRED with NULL parameter and the test has failed
because the kernel returns MPOL_LOCAL instead of MPOL_PREFERRED. Strictly
speaking this is breaking user interface but I am wondering whether this
really matter or is completely unexpected. The manual page explicitly
talks about this case
"
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.
"

I would be inclined to keep this inconsistency and see whether anybody
actually complains and have a relevant use for this behavior. The
cleanup which makes the code easier to maintain and less error prone
doesn't really deserve to get ditched just because of this IMHO.
--
Michal Hocko
SUSE Labs