summaryrefslogtreecommitdiff
path: root/arch/m32r/kernel/traps.c
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2014-01-02 20:58:43 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-09 20:25:14 (GMT)
commitaa2eb90a21ca53e02041416092d07811942e7c56 (patch)
tree47609ef309c1bfcbacb7e75dad6cdfc8b0f2a7f4 /arch/m32r/kernel/traps.c
parentf9f4487e62cd8659c85b3f9a69bfb5925f362672 (diff)
downloadlinux-fsl-qoriq-aa2eb90a21ca53e02041416092d07811942e7c56.tar.xz
mm: munlock: fix a bug where THP tail page is encountered
commit c424be1cbbf852e46acc84d73162af3066cd2c86 upstream. Since commit ff6a6da60b89 ("mm: accelerate munlock() treatment of THP pages") munlock skips tail pages of a munlocked THP page. However, when the head page already has PageMlocked unset, it will not skip the tail pages. Commit 7225522bb429 ("mm: munlock: batch non-THP page isolation and munlock+putback using pagevec") has added a PageTransHuge() check which contains VM_BUG_ON(PageTail(page)). Sasha Levin found this triggered using trinity, on the first tail page of a THP page without PageMlocked flag. This patch fixes the issue by skipping tail pages also in the case when PageMlocked flag is unset. There is still a possibility of race with THP page split between clearing PageMlocked and determining how many pages to skip. The race might result in former tail pages not being skipped, which is however no longer a bug, as during the skip the PageTail flags are cleared. However this race also affects correctness of NR_MLOCK accounting, which is to be fixed in a separate patch. Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Reported-by: Sasha Levin <sasha.levin@oracle.com> Cc: Michel Lespinasse <walken@google.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Rik van Riel <riel@redhat.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Hugh Dickins <hughd@google.com> Cc: Bob Liu <bob.liu@oracle.com> 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>
Diffstat (limited to 'arch/m32r/kernel/traps.c')
0 files changed, 0 insertions, 0 deletions