[RFC,v1,3/7] mm: publish raw_hwp_page in mm.h
Commit Message
raw_hwp_page will be needed by HugeTLB to determine if a raw subpage
in a hugepage is poisoned and either should be unmapped or not
faulted in at PAGE_SIZE PTE level
Signed-off-by: Jiaqi Yan <jiaqiyan@google.com>
---
include/linux/mm.h | 16 ++++++++++++++++
mm/memory-failure.c | 13 -------------
2 files changed, 16 insertions(+), 13 deletions(-)
@@ -3522,6 +3522,22 @@ enum mf_action_page_type {
*/
extern const struct attribute_group memory_failure_attr_group;
+#ifdef CONFIG_HUGETLB_PAGE
+/*
+ * Struct raw_hwp_page represents information about "raw error page",
+ * constructing singly linked list from ->_hugetlb_hwpoison field of folio.
+ */
+struct raw_hwp_page {
+ struct llist_node node;
+ struct page *page;
+};
+
+static inline struct llist_head *raw_hwp_list_head(struct folio *folio)
+{
+ return (struct llist_head *)&folio->_hugetlb_hwpoison;
+}
+#endif
+
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS)
extern void clear_huge_page(struct page *page,
unsigned long addr_hint,
@@ -1826,19 +1826,6 @@ EXPORT_SYMBOL_GPL(mf_dax_kill_procs);
#endif /* CONFIG_FS_DAX */
#ifdef CONFIG_HUGETLB_PAGE
-/*
- * Struct raw_hwp_page represents information about "raw error page",
- * constructing singly linked list from ->_hugetlb_hwpoison field of folio.
- */
-struct raw_hwp_page {
- struct llist_node node;
- struct page *page;
-};
-
-static inline struct llist_head *raw_hwp_list_head(struct folio *folio)
-{
- return (struct llist_head *)&folio->_hugetlb_hwpoison;
-}
static unsigned long __folio_free_raw_hwp(struct folio *folio, bool move_flag)
{