Thread (15 messages) 15 messages, 3 authors, 2012-08-02

Re: [RESEND PATCH 4/4 v3] mm: fix possible incorrect return value of move_pages() syscall

From: JoonSoo Kim <hidden>
Date: 2012-07-31 03:34:58
Also in: lkml

2012/7/31 Christoph Lameter [off-list ref]:
On Sat, 28 Jul 2012, JoonSoo Kim wrote:
quoted
2012/7/28 Christoph Lameter [off-list ref]:
quoted
On Sat, 28 Jul 2012, Joonsoo Kim wrote:
quoted
move_pages() syscall may return success in case that
do_move_page_to_node_array return positive value which means migration failed.
Nope. It only means that the migration for some pages has failed. This may
still be considered successful for the app if it moves 10000 pages and one
failed.

This patch would break the move_pages() syscall because an error code
return from do_move_pages_to_node_array() will cause the status byte for
each page move to not be updated anymore. Application will not be able to
tell anymore which pages were successfully moved and which are not.
In case of returning non-zero, valid status is not required according
to man page.
Cannot find a statement like that in the man page. The return code
description is incorrect. It should that that is returns the number of
pages not moved otherwise an error code (Michael please fix the manpage).
In man page, there is following statement.
"status is an array of integers that return the status of each page.  The array
only contains valid values if move_pages() did not return an error."

And current implementation of move_pages() syscall doesn't return the number
of pages not moved, just return 0 when it encounter some failed pages.
So, if u want to fix the man page, u should fix do_pages_move() first.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help