mm/hugetlb: remove redundant check in preparing and destroying gigantic page
Subsystems (2)
PATCH v2 1/1 mm/hugetlb: remove redundant check in preparing and destroying gigantic page
From: Yanfei Xu <[email protected]>
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.
--- mm/hugetlb.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
mm/hugetlb.c +2 -5
@@ -1219,8 +1219,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);
@@ -1501,9 +1500,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 ); }/*
Signature · 1 line
2.27.0
I'm sorry for forgetting to add David.
Now add David :)
Thanks,
Yanfei
Quoted 37 lines · On 2/2/21 7:20 PM, [email protected] wrote:
From: Yanfei Xu <[email protected]>
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.Signed-off-by Yanfei Xu <[email protected]>--- mm/hugetlb.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)mm/hugetlb.c +2
-5@@ -1219,8 +1219,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);@@ -1501,9 +1500,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 ); }/*
Mike Kravetz
Reviewed-byQuoted 17 lines · Yanfei
I'm sorry for forgetting to add David.
Now add David :)Thanks,
YanfeiQuoted 10 lines · On 2/2/21 7:20 PM, [email protected] wrote:
From: Yanfei Xu <[email protected]>
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.Signed-off-by Yanfei Xu <[email protected]>--- mm/hugetlb.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
I can not imagine a 'hugetlb gigantic page' being <= 1 order, so this change makes sense. Thanks,
Signature · 1 line
Mike Kravetz
Quoted 24 lines
Quoted 23 lines
mm/hugetlb.c +2
-5@@ -1219,8 +1219,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);@@ -1501,9 +1500,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 ); }/*
Quoted 27 lines · On 02.02.21 12:20, [email protected] wrote:
From: Yanfei Xu <[email protected]>
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.Signed-off-by Yanfei Xu <[email protected]>--- mm/hugetlb.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)mm/hugetlb.c +1
-2@@ -1219,8 +1219,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);
mm/hugetlb.c static void prep_compound_gigantic_page(struct page *page, unsigned int order) · line 1506
Quoted 10 lines
mm/hugetlb.c +1
-3@@ -1501,9 +1500,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 ); }/*
Signature · 3 lines
Thanks, David / dhildenb