Re: [PATCH 15/25] mm/fbatch: remove shake_folio() shake_page() from memory-failure
From: Miaohe Lin
Date: Tue Sep 08 2026 - 08:20:05 EST
On 2026/8/24 22:27, Hugh Dickins wrote:
> shake_folio()'s lru_add_drain_all() no longer serves a purpose, now that
> the per-cpu fbatch references are gone. Are the retries in get_any_page()
> then still useful? Not obvious, so keep them.
>
> Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx>
> ---
> mm/hwpoison-inject.c | 1 -
> mm/internal.h | 1 -
> mm/memory-failure.c | 38 +-------------------------------------
> 3 files changed, 1 insertion(+), 39 deletions(-)
>
> diff --git a/mm/hwpoison-inject.c b/mm/hwpoison-inject.c
> index a11222572f97..9eab4b7d25b2 100644
> --- a/mm/hwpoison-inject.c
> +++ b/mm/hwpoison-inject.c
> @@ -118,7 +118,6 @@ static int hwpoison_inject(void *data, u64 val)
> if (!hwpoison_filter_enable)
> goto inject;
>
> - shake_folio(folio);
> /*
> * This implies unable to support non-LRU pages except free page.
> */
> diff --git a/mm/internal.h b/mm/internal.h
> index ff4bd3a14539..9a25552cbd83 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -1140,7 +1140,6 @@ static inline bool node_reclaim_enabled(void)
> */
> #ifdef CONFIG_MEMORY_FAILURE
> int unmap_poisoned_folio(struct folio *folio, unsigned long pfn, bool must_kill);
> -void shake_folio(struct folio *folio);
> typedef int hwpoison_filter_func_t(struct page *p);
> void hwpoison_filter_register(hwpoison_filter_func_t *filter);
> void hwpoison_filter_unregister(void);
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index aaf14608b30e..2a6a01e260ed 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -310,30 +310,6 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)
> return ret;
> }
>
> -/*
> - * Unknown page type encountered. Try to check whether it can turn PageLRU by
> - * lru_add_drain_all.
> - */
> -void shake_folio(struct folio *folio)
> -{
> - if (folio_test_hugetlb(folio))
> - return;
> - /*
> - * TODO: Could shrink slab caches here if a lightweight range-based
> - * shrinker will be available.
I'm not sure whether we should keep above TODO. Anyway, this patch looks good to me.
Acked-by: Miaohe Lin <linmiaohe@xxxxxxxxxx>
Thanks.
.