From: Zi Yan <z...@nvidia.com>

As PUD THP is going to be added in the following patches, thp_order and
thp_nr can be HPAGE_PUD_ORDER and HPAGE_PUD_NR, respectively.

Signed-off-by: Zi Yan <z...@nvidia.com>
---
 include/linux/huge_mm.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index e9d228d4fc69..addd206150e2 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -279,7 +279,7 @@ static inline unsigned int thp_order(struct page *page)
 {
        VM_BUG_ON_PGFLAGS(PageTail(page), page);
        if (PageHead(page))
-               return HPAGE_PMD_ORDER;
+               return page[1].compound_order;
        return 0;
 }
 
@@ -291,7 +291,7 @@ static inline int thp_nr_pages(struct page *page)
 {
        VM_BUG_ON_PGFLAGS(PageTail(page), page);
        if (PageHead(page))
-               return HPAGE_PMD_NR;
+               return (1<<page[1].compound_order);
        return 1;
 }
 
-- 
2.28.0

Reply via email to