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/s390/mm/pgtable.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/s390/mm/pgtable.c')
-rw-r--r-- | arch/s390/mm/pgtable.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index 0a2e5e086749..1ea18fcfa211 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c | |||
@@ -1244,11 +1244,11 @@ void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, | |||
1244 | assert_spin_locked(&mm->page_table_lock); | 1244 | assert_spin_locked(&mm->page_table_lock); |
1245 | 1245 | ||
1246 | /* FIFO */ | 1246 | /* FIFO */ |
1247 | if (!mm->pmd_huge_pte) | 1247 | if (!pmd_huge_pte(mm, pmdp)) |
1248 | INIT_LIST_HEAD(lh); | 1248 | INIT_LIST_HEAD(lh); |
1249 | else | 1249 | else |
1250 | list_add(lh, (struct list_head *) mm->pmd_huge_pte); | 1250 | list_add(lh, (struct list_head *) pmd_huge_pte(mm, pmdp)); |
1251 | mm->pmd_huge_pte = pgtable; | 1251 | pmd_huge_pte(mm, pmdp) = pgtable; |
1252 | } | 1252 | } |
1253 | 1253 | ||
1254 | pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) | 1254 | pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) |
@@ -1260,12 +1260,12 @@ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) | |||
1260 | assert_spin_locked(&mm->page_table_lock); | 1260 | assert_spin_locked(&mm->page_table_lock); |
1261 | 1261 | ||
1262 | /* FIFO */ | 1262 | /* FIFO */ |
1263 | pgtable = mm->pmd_huge_pte; | 1263 | pgtable = pmd_huge_pte(mm, pmdp); |
1264 | lh = (struct list_head *) pgtable; | 1264 | lh = (struct list_head *) pgtable; |
1265 | if (list_empty(lh)) | 1265 | if (list_empty(lh)) |
1266 | mm->pmd_huge_pte = NULL; | 1266 | pmd_huge_pte(mm, pmdp) = NULL; |
1267 | else { | 1267 | else { |
1268 | mm->pmd_huge_pte = (pgtable_t) lh->next; | 1268 | pmd_huge_pte(mm, pmdp) = (pgtable_t) lh->next; |
1269 | list_del(lh); | 1269 | list_del(lh); |
1270 | } | 1270 | } |
1271 | ptep = (pte_t *) pgtable; | 1271 | ptep = (pte_t *) pgtable; |