summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorMichal Hocko <mhocko@suse.com>2018-04-20 14:55:35 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-20 17:18:35 -0700
commit8f175cf5c99dc0e3add2aac0ea1cd54e0f9ca87d (patch)
tree3885a1fc6fe50b2b3e384571b491e338e9e33551 /ipc
parente01e80634ecdde1dd113ac43b3adad21b47f3957 (diff)
downloadlinux-8f175cf5c99dc0e3add2aac0ea1cd54e0f9ca87d.tar.bz2
mm: fix do_pages_move status handling
Li Wang has reported that LTP move_pages04 test fails with the current tree: LTP move_pages04: TFAIL : move_pages04.c:143: status[1] is EPERM, expected EFAULT The test allocates an array of two pages, one is present while the other is not (resp. backed by zero page) and it expects EFAULT for the second page as the man page suggests. We are reporting EPERM which doesn't make any sense and this is a result of a bug from cf5f16b23ec9 ("mm: unclutter THP migration"). do_pages_move tries to handle as many pages in one batch as possible so we queue all pages with the same node target together and that corresponds to [start, i] range which is then used to update status array. add_page_for_migration will correctly notice the zero (resp. !present) page and returns with EFAULT which gets written to the status. But if this is the last page in the array we do not update start and so the last store_status after the loop will overwrite the range of the last batch with NUMA_NO_NODE (which corresponds to EPERM). Fix this by simply bailing out from the last flush if the pagelist is empty as there is clearly nothing more to do. Link: http://lkml.kernel.org/r/20180418121255.334-1-mhocko@kernel.org Fixes: cf5f16b23ec9 ("mm: unclutter THP migration") Signed-off-by: Michal Hocko <mhocko@suse.com> Reported-by: Li Wang <liwang@redhat.com> Tested-by: Li Wang <liwang@redhat.com> Cc: Zi Yan <zi.yan@cs.rutgers.edu> Cc: "Kirill A. Shutemov" <kirill@shutemov.name> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions