thp: reduce indentation level in change_huge_pmd()
authorKirill A. Shutemov <[email protected]>
Thu, 13 Apr 2017 21:56:17 +0000 (14:56 -0700)
committerLinus Torvalds <[email protected]>
Fri, 14 Apr 2017 01:24:20 +0000 (18:24 -0700)
commit0a85e51d37645e9ce57e5e1a30859e07810ed07c
treeb56010bad2b9f938904f3fc10b9b7e9bbe21e81e
parent76e32a2a084ed71b48179023cd8fdb3787c8a6ad
thp: reduce indentation level in change_huge_pmd()

Patch series "thp: fix few MADV_DONTNEED races"

For MADV_DONTNEED to work properly with huge pages, it's critical to not
clear pmd intermittently unless you hold down_write(mmap_sem).

Otherwise MADV_DONTNEED can miss the THP which can lead to userspace
breakage.

See example of such race in commit message of patch 2/4.

All these races are found by code inspection.  I haven't seen them
triggered.  I don't think it's worth to apply them to stable@.

This patch (of 4):

Restructure code in preparation for a fix.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Kirill A. Shutemov <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Hillf Danton <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/huge_memory.c