Re: mm: move_pages syscall can't return ENOENT when pages are notpresent

From: Brice Goglin
Date: Wed May 09 2012 - 10:08:17 EST


Le 09/05/2012 10:58, Zhouping Liu a Ãcrit :
> hi, all
>
> Recently, I found an error in move_pages syscall:
>
> depending on move_pages(2), when page is not present,
> it should fail with ENOENT, in fact, it's ok without
> any errno.
>
> the following reproducer can easily reproduce
> the issue, suggest you get more details by strace.
> inside reproducer, I try to move a non-exist page from
> node 1 to node 0.
>

If I understand correctly, 3 pages should migrate properly but the last
one cannot migrate because it's not present. In this case, move_pages
returns success. -ENOENT is set in the status array, not in the return
value/errno.

In the past, if *all* pages failed to migrate, move_pages would return
ENOENT instead of success, but the behavior was inconsistent so I
changed that in commit e78bbfa8262424417a29349a8064a535053912b9 as
Wanlong Gao said. But that should not matter here since 3 pages out of 4
are successfully migrated from what I understand.

The manpage should be updated (remove ENOENT from the ERRORS section,
but keep it in the "Page states in the status array" section).

Brice

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/