]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
mm, compaction: prevent VM_BUG_ON when terminating freeing scanner
authorDavid Rientjes <rientjes@google.com>
Thu, 14 Jul 2016 19:06:50 +0000 (12:06 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 12 Aug 2016 07:07:11 +0000 (09:07 +0200)
commit3b4b3cb85cff5d9868868b18ef25f5851d5a9a02
treec112a4d4844cded8564394ed153a27de57eb29e7
parent92f614d8f83b810042d9b3970472d5823651d889
mm, compaction: prevent VM_BUG_ON when terminating freeing scanner

BugLink: http://bugs.launchpad.net/bugs/1611833
commit a46cbf3bc53b6a93fb84a5ffb288c354fa807954 upstream.

It's possible to isolate some freepages in a pageblock and then fail
split_free_page() due to the low watermark check.  In this case, we hit
VM_BUG_ON() because the freeing scanner terminated early without a
contended lock or enough freepages.

This should never have been a VM_BUG_ON() since it's not a fatal
condition.  It should have been a VM_WARN_ON() at best, or even handled
gracefully.

Regardless, we need to terminate anytime the full pageblock scan was not
done.  The logic belongs in isolate_freepages_block(), so handle its
state gracefully by terminating the pageblock loop and making a note to
restart at the same pageblock next time since it was not possible to
complete the scan this time.

[rientjes@google.com: don't rescan pages in a pageblock]
Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1607111244150.83138@chino.kir.corp.google.com
Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1606291436300.145590@chino.kir.corp.google.com
Signed-off-by: David Rientjes <rientjes@google.com>
Reported-by: Minchan Kim <minchan@kernel.org>
Tested-by: Minchan Kim <minchan@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
mm/compaction.c