path: root/mm/pagewalk.c
diff options
authorKOSAKI Motohiro <>2011-07-25 17:12:10 -0700
committerLinus Torvalds <>2011-07-25 20:57:08 -0700
commitc27fe4c8942d3ca715986f79cc26f44608d7d9fb (patch)
treed954d0417c941f5e51cf029608311ef04acd9575 /mm/pagewalk.c
parent6c6d5280431544e4036886ea74e3334a98bc5f96 (diff)
pagewalk: add locking-rule comments
Originally, walk_hugetlb_range() didn't require a caller take any lock. But commit d33b9f45bd ("mm: hugetlb: fix hugepage memory leak in walk_page_range") changed its rule. Because it added find_vma() call in walk_hugetlb_range(). Any locking-rule change commit should write a doc too. [ clarify comment] Signed-off-by: KOSAKI Motohiro <> Cc: Naoya Horiguchi <> Cc: Hiroyuki Kamezawa <> Cc: Andrea Arcangeli <> Cc: Matt Mackall <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/pagewalk.c')
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/pagewalk.c b/mm/pagewalk.c
index ee4ff87c58c1..f7929406e776 100644
--- a/mm/pagewalk.c
+++ b/mm/pagewalk.c
@@ -181,6 +181,9 @@ static int walk_hugetlb_range(struct vm_area_struct *vma,
* If any callback returns a non-zero value, the walk is aborted and
* the return value is propagated back to the caller. Otherwise 0 is returned.
+ *
+ * walk->mm->mmap_sem must be held for at least read if walk->hugetlb_entry
+ * is !NULL.
int walk_page_range(unsigned long addr, unsigned long end,
struct mm_walk *walk)