original_kernel/arch/x86/mm
Mel Gorman 32b154c0b0 x86: ignore VM_LOCKED when determining if hugetlb-backed page tables can be shared or not
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=13302

On x86 and x86-64, it is possible that page tables are shared beween
shared mappings backed by hugetlbfs.  As part of this,
page_table_shareable() checks a pair of vma->vm_flags and they must match
if they are to be shared.  All VMA flags are taken into account, including
VM_LOCKED.

The problem is that VM_LOCKED is cleared on fork().  When a process with a
shared memory segment forks() to exec() a helper, there will be shared
VMAs with different flags.  The impact is that the shared segment is
sometimes considered shareable and other times not, depending on what
process is checking.

What happens is that the segment page tables are being shared but the
count is inaccurate depending on the ordering of events.  As the page
tables are freed with put_page(), bad pmd's are found when some of the
children exit.  The hugepage counters also get corrupted and the Total and
Free count will no longer match even when all the hugepage-backed regions
are freed.  This requires a reboot of the machine to "fix".

This patch addresses the problem by comparing all flags except VM_LOCKED
when deciding if pagetables should be shared or not for hugetlbfs-backed
mapping.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: <stable@kernel.org>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: <starlight@binnacle.cx>
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Adam Litke <agl@us.ibm.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-05-29 08:40:03 -07:00
..
Makefile
dump_pagetables.c
extable.c
fault.c
gup.c
highmem_32.c
hugetlbpage.c x86: ignore VM_LOCKED when determining if hugetlb-backed page tables can be shared or not 2009-05-29 08:40:03 -07:00
init.c x86-64: finish cleanup_highmaps()'s job wrt. _brk_end 2009-05-07 21:51:34 -07:00
init_32.c
init_64.c
iomap_32.c
ioremap.c
k8topology_64.c
kmmio.c tracing: x86, mmiotrace: fix range test 2009-04-29 11:32:22 +02:00
memtest.c
mmap.c
mmio-mod.c
numa.c
numa_32.c x86: mm/numa_32.c calculate_numa_remap_pages should use __init 2009-04-17 22:43:13 +02:00
numa_64.c x86: check boundary in setup_node_bootmem() 2009-04-23 09:58:56 +02:00
pageattr-test.c
pageattr.c x86: avoid back to back on_each_cpu in cpa_flush_array 2009-05-26 13:12:12 -07:00
pat.c
pf_in.c
pf_in.h
pgtable.c
pgtable_32.c
srat_32.c x86: Fix a typo in a printk message 2009-05-06 12:23:12 +02:00
srat_64.c x86, srat: do not register nodes beyond e820 map 2009-05-06 10:49:07 +02:00
testmmiotrace.c
tlb.c