On 25.07.24 03:16, Kefeng Wang wrote:
Add unmap_posioned_folio() helper which will be reused by
do_migrate_range() from memory hotplug soon.
Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
---
mm/internal.h | 9 +++++++++
mm/memory-failure.c | 43 ++++++++++++++++++++++++++-----------------
2 files changed, 35 insertions(+), 17 deletions(-)
diff --git a/mm/internal.h b/mm/internal.h
index 7a3bcc6d95e7..c5bd24c4fa3a 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -1069,6 +1069,8 @@ static inline int find_next_best_node(int node, nodemask_t *used_node_mask)
/*
* mm/memory-failure.c
*/
+#ifdef CONFIG_MEMORY_FAILURE
+int unmap_posioned_folio(struct folio *folio, enum ttu_flags ttu);
void shake_folio(struct folio *folio);
extern int hwpoison_filter(struct page *p);
@@ -1089,6 +1091,13 @@ void add_to_kill_ksm(struct task_struct *tsk, struct page *p,
unsigned long ksm_addr);
unsigned long page_mapped_in_vma(struct page *page, struct vm_area_struct *vma);
+#else
+static inline int unmap_posioned_folio(struct folio *folio, enum ttu_flags ttu)
+{
+ return 0;
+}
+#endif
+
Was wondering if we could come up with a better name (something that
starts with folio_*), but wasn't able to come up with something I liked
more.
Acked-by: David Hildenbrand <david@xxxxxxxxxx>
--
Cheers,
David / dhildenb