aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2013-11-14 17:31:10 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-14 19:32:15 -0500
commit9491846fca57e9326b6673716c386b76fc13ebca (patch)
treeaf2124bfc94cab5038a0eb3a5df8e67a88466890
parente009bb30c8df8a52a9622b616b67436b6a03a0cd (diff)
x86, mm: enable split page table lock for PMD level
Enable PMD split page table lock for X86_64 and PAE. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Tested-by: Alex Thorlton <athorlton@sgi.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: "Eric W . Biederman" <ebiederm@xmission.com> Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Andi Kleen <ak@linux.intel.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Dave Jones <davej@redhat.com> Cc: David Howells <dhowells@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Kees Cook <keescook@chromium.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rik van Riel <riel@redhat.com> Cc: Robin Holt <robinmholt@gmail.com> Cc: Sedat Dilek <sedat.dilek@gmail.com> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Hugh Dickins <hughd@google.com> Reviewed-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/x86/Kconfig4
-rw-r--r--arch/x86/include/asm/pgalloc.h11
2 files changed, 14 insertions, 1 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6e3e1cb3f6a0..af5513e5798a 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1885,6 +1885,10 @@ config USE_PERCPU_NUMA_NODE_ID
1885 def_bool y 1885 def_bool y
1886 depends on NUMA 1886 depends on NUMA
1887 1887
1888config ARCH_ENABLE_SPLIT_PMD_PTLOCK
1889 def_bool y
1890 depends on X86_64 || X86_PAE
1891
1888menu "Power management and ACPI options" 1892menu "Power management and ACPI options"
1889 1893
1890config ARCH_HIBERNATION_HEADER 1894config ARCH_HIBERNATION_HEADER
diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h
index b4389a468fb6..c4412e972bbd 100644
--- a/arch/x86/include/asm/pgalloc.h
+++ b/arch/x86/include/asm/pgalloc.h
@@ -80,12 +80,21 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
80#if PAGETABLE_LEVELS > 2 80#if PAGETABLE_LEVELS > 2
81static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) 81static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
82{ 82{
83 return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 83 struct page *page;
84 page = alloc_pages(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO, 0);
85 if (!page)
86 return NULL;
87 if (!pgtable_pmd_page_ctor(page)) {
88 __free_pages(page, 0);
89 return NULL;
90 }
91 return (pmd_t *)page_address(page);
84} 92}
85 93
86static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) 94static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
87{ 95{
88 BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); 96 BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
97 pgtable_pmd_page_dtor(virt_to_page(pmd));
89 free_page((unsigned long)pmd); 98 free_page((unsigned long)pmd);
90} 99}
91 100