Messages in this thread Patch in this message | | | From | Zi Yan <> | Subject | [RFC PATCH v2 06/30] mm: change thp_order and thp_nr as we will have not just PMD THPs. | Date | Mon, 28 Sep 2020 13:54:04 -0400 |
| |
From: Zi Yan <ziy@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 <ziy@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
| |