Re: [PATCH RFC] move_pages.2: move_pages() can return positive value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Jan,

On 08/24/2018 02:27 PM, Jan Stancek wrote:
> Since the rework done in a49bd4d71637 ("mm, numa: rework do_pages_move"),
> move_pages() can return also positive value.
> 
> Signed-off-by: Jan Stancek <jstancek@xxxxxxxxxx>
> ---
>  man2/move_pages.2 | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> https://github.com/linux-test-project/ltp/issues/388
> 
> diff --git a/man2/move_pages.2 b/man2/move_pages.2
> index f2c4f7f7a269..35cf6de1ba78 100644
> --- a/man2/move_pages.2
> +++ b/man2/move_pages.2
> @@ -157,9 +157,11 @@ The page is not present.
>  .B -ENOMEM
>  Unable to allocate memory on target node.
>  .SH RETURN VALUE
> -On success
> +On success (since 4.17)
>  .BR move_pages ()
> -returns zero.
> +returns the number of pages that could not be moved
> +(i.e., a return of zero means that all pages were successfully moved,
> +older kernels return 0).
>  .\" FIXME . Is the following quite true: does the wrapper in numactl
>  .\" do the right thing?
>  On error, it returns \-1, and sets

The wording here seems a bit confusing, because the detail about
older kernel behavior is hidden in a parenthetical aside. Can you 
confirm what I understand:

[[
Before Linux 4.17, move_pages() always returned 0 on success.
[But, what is the return value if not all of the pages could
be moved? Is it 0 or -1?]

Since Linux, a successful call to move_pages() returns the number
of pages that could not be moved (i.e., a return of zero means that 
all pages were successfully moved, older kernels return 0).
]]

If that's correct, then I think the new text should read more
like that, withe open question answered.

How does that sound?

Thanks,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux