[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200212041845.25879-9-willy@infradead.org>
Date: Tue, 11 Feb 2020 20:18:28 -0800
From: Matthew Wilcox <willy@...radead.org>
To: linux-fsdevel@...r.kernel.org, linux-mm@...ck.org
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 08/25] mm: Introduce thp_order
From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
Like compound_order() except 0 when THP is disabled.
Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
---
include/linux/huge_mm.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 3680ae2d9019..3de788ee25bd 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -233,6 +233,7 @@ static inline spinlock_t *pud_trans_huge_lock(pud_t *pud,
#define hpage_nr_pages(page) (long)compound_nr(page)
#define thp_size(page) page_size(page)
+#define thp_order(page) compound_order(page)
struct page *follow_devmap_pmd(struct vm_area_struct *vma, unsigned long addr,
pmd_t *pmd, int flags, struct dev_pagemap **pgmap);
@@ -288,6 +289,7 @@ static inline struct list_head *page_deferred_list(struct page *page)
#define hpage_nr_pages(x) 1L
#define thp_size(x) PAGE_SIZE
+#define thp_order(x) 0U
static inline bool __transparent_hugepage_enabled(struct vm_area_struct *vma)
{
--
2.25.0
Powered by blists - more mailing lists