diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2013-11-14 17:30:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 19:32:14 -0500 |
commit | c389a250ab4cfa4a3775d9f2c45271618af6d5b2 (patch) | |
tree | 7028da0aba97f58ccae65b522aed0a424088b1ca /mm | |
parent | 117b0791ac42f2ec447bc864e70ad622b5604059 (diff) |
mm, thp: do not access mm->pmd_huge_pte directly
Currently mm->pmd_huge_pte protected by page table lock. It will not
work with split lock. We have to have per-pmd pmd_huge_pte for proper
access serialization.
For now, let's just introduce wrapper to access mm->pmd_huge_pte.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Tested-by: Alex Thorlton <athorlton@sgi.com>
Cc: 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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/pgtable-generic.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index 3929a40bd6c0..41fee3e5d570 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c | |||
@@ -154,11 +154,11 @@ void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, | |||
154 | assert_spin_locked(&mm->page_table_lock); | 154 | assert_spin_locked(&mm->page_table_lock); |
155 | 155 | ||
156 | /* FIFO */ | 156 | /* FIFO */ |
157 | if (!mm->pmd_huge_pte) | 157 | if (!pmd_huge_pte(mm, pmdp)) |
158 | INIT_LIST_HEAD(&pgtable->lru); | 158 | INIT_LIST_HEAD(&pgtable->lru); |
159 | else | 159 | else |
160 | list_add(&pgtable->lru, &mm->pmd_huge_pte->lru); | 160 | list_add(&pgtable->lru, &pmd_huge_pte(mm, pmdp)->lru); |
161 | mm->pmd_huge_pte = pgtable; | 161 | pmd_huge_pte(mm, pmdp) = pgtable; |
162 | } | 162 | } |
163 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | 163 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ |
164 | #endif | 164 | #endif |
@@ -173,11 +173,11 @@ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) | |||
173 | assert_spin_locked(&mm->page_table_lock); | 173 | assert_spin_locked(&mm->page_table_lock); |
174 | 174 | ||
175 | /* FIFO */ | 175 | /* FIFO */ |
176 | pgtable = mm->pmd_huge_pte; | 176 | pgtable = pmd_huge_pte(mm, pmdp); |
177 | if (list_empty(&pgtable->lru)) | 177 | if (list_empty(&pgtable->lru)) |
178 | mm->pmd_huge_pte = NULL; | 178 | pmd_huge_pte(mm, pmdp) = NULL; |
179 | else { | 179 | else { |
180 | mm->pmd_huge_pte = list_entry(pgtable->lru.next, | 180 | pmd_huge_pte(mm, pmdp) = list_entry(pgtable->lru.next, |
181 | struct page, lru); | 181 | struct page, lru); |
182 | list_del(&pgtable->lru); | 182 | list_del(&pgtable->lru); |
183 | } | 183 | } |