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 /arch/sparc/mm/tlb.c | |
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 'arch/sparc/mm/tlb.c')
-rw-r--r-- | arch/sparc/mm/tlb.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/sparc/mm/tlb.c b/arch/sparc/mm/tlb.c index 7a91f288c708..656cc46a81f5 100644 --- a/arch/sparc/mm/tlb.c +++ b/arch/sparc/mm/tlb.c | |||
@@ -196,11 +196,11 @@ void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, | |||
196 | assert_spin_locked(&mm->page_table_lock); | 196 | assert_spin_locked(&mm->page_table_lock); |
197 | 197 | ||
198 | /* FIFO */ | 198 | /* FIFO */ |
199 | if (!mm->pmd_huge_pte) | 199 | if (!pmd_huge_pte(mm, pmdp)) |
200 | INIT_LIST_HEAD(lh); | 200 | INIT_LIST_HEAD(lh); |
201 | else | 201 | else |
202 | list_add(lh, (struct list_head *) mm->pmd_huge_pte); | 202 | list_add(lh, (struct list_head *) pmd_huge_pte(mm, pmdp)); |
203 | mm->pmd_huge_pte = pgtable; | 203 | pmd_huge_pte(mm, pmdp) = pgtable; |
204 | } | 204 | } |
205 | 205 | ||
206 | pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) | 206 | pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) |
@@ -211,12 +211,12 @@ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) | |||
211 | assert_spin_locked(&mm->page_table_lock); | 211 | assert_spin_locked(&mm->page_table_lock); |
212 | 212 | ||
213 | /* FIFO */ | 213 | /* FIFO */ |
214 | pgtable = mm->pmd_huge_pte; | 214 | pgtable = pmd_huge_pte(mm, pmdp); |
215 | lh = (struct list_head *) pgtable; | 215 | lh = (struct list_head *) pgtable; |
216 | if (list_empty(lh)) | 216 | if (list_empty(lh)) |
217 | mm->pmd_huge_pte = NULL; | 217 | pmd_huge_pte(mm, pmdp) = NULL; |
218 | else { | 218 | else { |
219 | mm->pmd_huge_pte = (pgtable_t) lh->next; | 219 | pmd_huge_pte(mm, pmdp) = (pgtable_t) lh->next; |
220 | list_del(lh); | 220 | list_del(lh); |
221 | } | 221 | } |
222 | pte_val(pgtable[0]) = 0; | 222 | pte_val(pgtable[0]) = 0; |