]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
mm/hugetlb: remove redundant check in preparing and destroying gigantic page
authorYanfei Xu <yanfei.xu@windriver.com>
Wed, 24 Feb 2021 20:07:22 +0000 (12:07 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:31:36 +0000 (09:31 +0200)
BugLink: https://bugs.launchpad.net/bugs/1938340
[ Upstream commit 5291c09b3edb657f23c1939750c702ba2d74932f ]

Gigantic page is a compound page and its order is more than 1.  Thus it
must be available for hpage_pincount.  Let's remove the redundant check
for gigantic page.

Link: https://lkml.kernel.org/r/20210202112002.73170-1-yanfei.xu@windriver.com
Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
mm/hugetlb.c

index 63f7cad1dba1429d404f4b6afb4c7fcd4a0836a1..90d8488f0f227e27cc1cce383340a6f59e1ceebe 100644 (file)
@@ -1252,8 +1252,7 @@ static void destroy_compound_gigantic_page(struct page *page,
        struct page *p = page + 1;
 
        atomic_set(compound_mapcount_ptr(page), 0);
-       if (hpage_pincount_available(page))
-               atomic_set(compound_pincount_ptr(page), 0);
+       atomic_set(compound_pincount_ptr(page), 0);
 
        for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) {
                clear_compound_head(p);
@@ -1583,9 +1582,7 @@ static void prep_compound_gigantic_page(struct page *page, unsigned int order)
                set_compound_head(p, page);
        }
        atomic_set(compound_mapcount_ptr(page), -1);
-
-       if (hpage_pincount_available(page))
-               atomic_set(compound_pincount_ptr(page), 0);
+       atomic_set(compound_pincount_ptr(page), 0);
 }
 
 /*