Re: [PATCH] mm/migrate.c: also overwrite error when it is bigger than zero

From: Mike Kravetz
Date: Fri Jan 17 2020 - 20:40:30 EST


On 1/17/20 3:48 PM, Wei Yang wrote:
> This is another point I think current code is not working well. And actually,
> the behavior is not well defined or our kernel is broken for a while.
>
> When you look at the man page, it says:
>
> RETURN VALUE
> On success move_pages() returns zero. On error, it returns -1, and sets errno to indicate the error
>

Is this from your migrate_pages(2) man page?

The latest version of the migrate_pages(2) man page in the git repo has this
for RETURN VALUE.

RETURN VALUE
On success migrate_pages() returns the number of pages that could not
be moved (i.e., a return of zero means that all pages were successfully
moved). On error, it returns -1, and sets errno to indicate the error.

--
Mike Kravetz