summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJules Irenge <jbi.octave@gmail.com>2020-04-07 05:08:09 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2020-04-07 19:43:41 +0200
commit1b2a1e7bb9ce9936d6839c1023737ccff7889dee (patch)
tree2711723141664410c339abbf3308a807817cafe9
parentmm/compaction: add missing annotation for compact_lock_irqsave (diff)
downloadlinux-1b2a1e7bb9ce9936d6839c1023737ccff7889dee.tar.xz
linux-1b2a1e7bb9ce9936d6839c1023737ccff7889dee.zip
mm/hugetlb: add missing annotation for gather_surplus_pages()
Sparse reports a warning at gather_surplus_pages() warning: context imbalance in hugetlb_cow() - unexpected unlock The root cause is the missing annotation at gather_surplus_pages() Add the missing __must_hold(&hugetlb_lock) Signed-off-by: Jules Irenge <jbi.octave@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com> Link: http://lkml.kernel.org/r/20200214204741.94112-7-jbi.octave@gmail.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/hugetlb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index f9ea1e5197b4..f5fb53fdfa02 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2010,6 +2010,7 @@ struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma,
* of size 'delta'.
*/
static int gather_surplus_pages(struct hstate *h, int delta)
+ __must_hold(&hugetlb_lock)
{
struct list_head surplus_list;
struct page *page, *tmp;