linux/arch
Andrea Arcangeli 027ef6c878 mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP
In many places !pmd_present has been converted to pmd_none.  For pmds
that's equivalent and pmd_none is quicker so using pmd_none is better.

However (unless we delete pmd_present) we should provide an accurate
pmd_present too.  This will avoid the risk of code thinking the pmd is non
present because it's under __split_huge_page_map, see the pmd_mknotpresent
there and the comment above it.

If the page has been mprotected as PROT_NONE, it would also lead to a
pmd_present false negative in the same way as the race with
split_huge_page.

Because the PSE bit stays on at all times (both during split_huge_page and
when the _PAGE_PROTNONE bit get set), we could only check for the PSE bit,
but checking the PROTNONE bit too is still good to remember pmd_present
must always keep PROT_NONE into account.

This explains a not reproducible BUG_ON that was seldom reported on the
lists.

The same issue is in pmd_large, it would go wrong with both PROT_NONE and
if it races with split_huge_page.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: Johannes Weiner <jweiner@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-10-09 16:22:57 +09:00
..
alpha mm: kill vma flag VM_RESERVED and mm->reserved_vm counter 2012-10-09 16:22:19 +09:00
arm readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
arm64 Kconfig: clean up the "#if defined(arch)" list for exception-trace sysctl entry 2012-10-09 16:22:14 +09:00
avr32 readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
blackfin Kconfig: clean up the long arch list for the UID16 config option 2012-10-09 16:22:13 +09:00
c6x Merge branch 'uapi-prep' of git://git.infradead.org/users/dhowells/linux-headers 2012-10-07 07:55:10 +09:00
cris readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
frv Kconfig: clean up the long arch list for the DEBUG_BUGVERBOSE config option 2012-10-09 16:22:14 +09:00
h8300 Kconfig: clean up the long arch list for the UID16 config option 2012-10-09 16:22:13 +09:00
hexagon readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
ia64 mm: fix-up zone present pages 2012-10-09 16:22:54 +09:00
m32r Kconfig: clean up the long arch list for the DEBUG_BUGVERBOSE config option 2012-10-09 16:22:14 +09:00
m68k readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
microblaze readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
mips readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
mn10300 cross-arch: don't corrupt personality flags upon exec() 2012-10-06 03:04:47 +09:00
openrisc readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
parisc mm: replace vma prio_tree with an interval tree 2012-10-09 16:22:39 +09:00
powerpc readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
s390 readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
score Merge branch 'uapi-prep' of git://git.infradead.org/users/dhowells/linux-headers 2012-10-07 07:55:10 +09:00
sh readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
sparc readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
tile readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
um readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
unicore32 mm: kill vma flag VM_RESERVED and mm->reserved_vm counter 2012-10-09 16:22:19 +09:00
x86 mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP 2012-10-09 16:22:57 +09:00
xtensa readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
.gitignore
Kconfig thp, x86: introduce HAVE_ARCH_TRANSPARENT_HUGEPAGE 2012-10-09 16:22:29 +09:00