]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
mm: enable thp migration for shmem thp
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Fri, 20 Apr 2018 21:55:45 +0000 (14:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 21 Apr 2018 00:18:35 +0000 (17:18 -0700)
commite71769ae52609ea0044a9901709042e5634c2306
treefb590bf62ea72a883da02c555b1833c2db1d45e8
parent2e898e4c0a3897ccd434adac5abb8330194f527b
mm: enable thp migration for shmem thp

My testing for the latest kernel supporting thp migration showed an
infinite loop in offlining the memory block that is filled with shmem
thps.  We can get out of the loop with a signal, but kernel should return
with failure in this case.

What happens in the loop is that scan_movable_pages() repeats returning
the same pfn without any progress.  That's because page migration always
fails for shmem thps.

In memory offline code, memory blocks containing unmovable pages should be
prevented from being offline targets by has_unmovable_pages() inside
start_isolate_page_range().  So it's possible to change migratability for
non-anonymous thps to avoid the issue, but it introduces more complex and
thp-specific handling in migration code, so it might not good.

So this patch is suggesting to fix the issue by enabling thp migration for
shmem thp.  Both of anon/shmem thp are migratable so we don't need
precheck about the type of thps.

Link: http://lkml.kernel.org/r/20180406030706.GA2434@hori1.linux.bs1.fc.nec.co.jp
Fixes: commit 72b39cfc4d75 ("mm, memory_hotplug: do not fail offlining too early")
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Zi Yan <zi.yan@sent.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/huge_memory.c
mm/migrate.c
mm/rmap.c