aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2013-11-14 17:30:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-14 19:32:14 -0500
commitbf929152e9f6c49b66fad4ebf08cc95b02ce48f5 (patch)
tree21b54239e0ad98f12a44039047ed96d775e6c67d /include/linux
parent9a86cb7bdc4ccbe3f99a1ca275b90a322a90f9ce (diff)
mm, thp: change pmd_trans_huge_lock() to return taken lock
With split ptlock it's important to know which lock pmd_trans_huge_lock() took. This patch adds one more parameter to the function to return the lock. In most places migration to new api is trivial. Exception is move_huge_pmd(): we need to take two locks if pmd tables are different. Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> 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: "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 'include/linux')
-rw-r--r--include/linux/huge_mm.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 3935428c57cf..4aca0d8da112 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -129,15 +129,15 @@ extern void __vma_adjust_trans_huge(struct vm_area_struct *vma,
129 unsigned long start, 129 unsigned long start,
130 unsigned long end, 130 unsigned long end,
131 long adjust_next); 131 long adjust_next);
132extern int __pmd_trans_huge_lock(pmd_t *pmd, 132extern int __pmd_trans_huge_lock(pmd_t *pmd, struct vm_area_struct *vma,
133 struct vm_area_struct *vma); 133 spinlock_t **ptl);
134/* mmap_sem must be held on entry */ 134/* mmap_sem must be held on entry */
135static inline int pmd_trans_huge_lock(pmd_t *pmd, 135static inline int pmd_trans_huge_lock(pmd_t *pmd, struct vm_area_struct *vma,
136 struct vm_area_struct *vma) 136 spinlock_t **ptl)
137{ 137{
138 VM_BUG_ON(!rwsem_is_locked(&vma->vm_mm->mmap_sem)); 138 VM_BUG_ON(!rwsem_is_locked(&vma->vm_mm->mmap_sem));
139 if (pmd_trans_huge(*pmd)) 139 if (pmd_trans_huge(*pmd))
140 return __pmd_trans_huge_lock(pmd, vma); 140 return __pmd_trans_huge_lock(pmd, vma, ptl);
141 else 141 else
142 return 0; 142 return 0;
143} 143}
@@ -215,8 +215,8 @@ static inline void vma_adjust_trans_huge(struct vm_area_struct *vma,
215 long adjust_next) 215 long adjust_next)
216{ 216{
217} 217}
218static inline int pmd_trans_huge_lock(pmd_t *pmd, 218static inline int pmd_trans_huge_lock(pmd_t *pmd, struct vm_area_struct *vma,
219 struct vm_area_struct *vma) 219 spinlock_t **ptl)
220{ 220{
221 return 0; 221 return 0;
222} 222}