linux-uconsole/arch
Andrea Arcangeli 6c06bd661d mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP
commit 027ef6c878 upstream.

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>
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>
2012-10-13 05:28:10 +09:00
..
alpha Redefine ATOMIC_INIT and ATOMIC64_INIT to drop the casts 2012-10-02 09:47:25 -07:00
arm ARM: 7467/1: mutex: use generic xchg-based implementation for ARMv6+ 2012-10-02 09:47:55 -07:00
avr32 avr32: select generic atomic64_t support 2012-03-12 10:32:57 -07:00
blackfin rtc: fix build warnings in defconfigs 2011-06-15 20:04:02 -07:00
cris cris: add missing declaration of kgdb_init() and breakpoint() 2011-08-15 18:31:32 -07:00
frv Merge branch 'setns' 2011-05-28 10:51:01 -07:00
h8300 Merge branch 'setns' 2011-05-28 10:51:01 -07:00
ia64 random: remove rand_initialize_irq() 2012-08-15 12:04:28 -07:00
m32r Fix node_start/end_pfn() definition for mm/page_cgroup.c 2011-06-27 14:13:09 -07:00
m68k m68k: Correct the Atari ALLOWINT definition 2012-08-09 08:27:53 -07:00
microblaze Merge branch 'setns' 2011-05-28 10:51:01 -07:00
mips MIPS: Properly align the .data..init_task section. 2012-08-01 12:26:54 -07:00
mn10300 mn10300: only add -mmem-funcs to KBUILD_CFLAGS if gcc supports it 2012-10-13 05:28:02 +09:00
parisc PARISC: Redefine ATOMIC_INIT and ATOMIC64_INIT to drop the casts 2012-09-14 10:00:51 -07:00
powerpc powerpc: Restore correct DSCR in context switch 2012-09-14 10:00:49 -07:00
s390 s390/compat: fix mmap compat system calls 2012-08-26 15:12:10 -07:00
score score: fix off-by-one index into syscall table 2012-01-25 17:25:04 -08:00
sh oprofile, arm/sh: Fix oprofile_arch_exit() linkage issue 2012-01-06 14:13:57 -08:00
sparc KEYS: Use the compat keyctl() syscall wrapper on Sparc64 for Sparc32 compat 2012-06-01 15:12:54 +08:00
tile tile: fix bug where fls(0) was not returning 0 2012-06-01 15:13:00 +08:00
um um: Implement a custom pte_same() function 2012-06-01 15:12:55 +08:00
unicore32 unicore32: using generic-y format for one line asm-generic files 2011-06-09 16:29:52 +08:00
x86 mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP 2012-10-13 05:28:10 +09:00
xtensa xtensa: prevent arbitrary read in ptrace 2011-08-04 21:58:39 -07:00
.gitignore
Kconfig mm, powerpc: move the RCU page-table freeing into generic code 2011-05-25 08:39:16 -07:00