Hugh Dickins 7e09e738af mm: fix swapops.h:131 bug if remap_file_pages raced migration
Add remove_linear_migration_ptes_from_nonlinear(), to fix an interesting
little include/linux/swapops.h:131 BUG_ON(!PageLocked) found by trinity:
indicating that remove_migration_ptes() failed to find one of the
migration entries that was temporarily inserted.

The problem comes from remap_file_pages()'s switch from vma_interval_tree
(good for inserting the migration entry) to i_mmap_nonlinear list (no good
for locating it again); but can only be a problem if the remap_file_pages()
range does not cover the whole of the vma (zap_pte() clears the range).

remove_migration_ptes() needs a file_nonlinear method to go down the
i_mmap_nonlinear list, applying linear location to look for migration
entries in those vmas too, just in case there was this race.

The file_nonlinear method does need rmap_walk_control.arg to do this;
but it never needed vma passed in - vma comes from its own iteration.

Reported-and-tested-by: Dave Jones <davej@redhat.com>
Reported-and-tested-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-03-20 22:09:09 -07:00
..
2012-01-03 22:54:56 -05:00
2011-07-26 16:49:47 -07:00
2014-03-04 07:55:47 -08:00
2014-01-30 16:56:55 -08:00
2014-03-04 07:55:47 -08:00
2014-01-23 16:36:52 -08:00
2014-01-27 21:02:39 -08:00
2014-01-23 16:36:53 -08:00
2013-10-16 21:35:53 -07:00
2010-05-21 18:31:21 -04:00
2012-06-20 14:39:36 -07:00
2014-03-04 07:55:47 -08:00
2014-01-30 16:56:55 -08:00