Re: [PATCH] mm: split out memory-failure declarations from internal.h
From: Zi Yan
Date: Wed Nov 04 2026 - 18:06:21 EST
On 4 Nov 2026, at 11:45, Breno Leitao wrote:
> mm/internal.h carries the memory failure declarations, but only seven
> of the 81 .c files that include it use them.
>
> Move memory failure declarations to a new mm/memory-failure.h and
> include that from those seven files that need them.
>
> Move the block as is, including take_page_off_buddy(),
> put_page_back_buddy() and page_mapped_in_vma(): they live in
> page_alloc.c and page_vma_mapped.c, but are built only for
> CONFIG_MEMORY_FAILURE and called only from memory-failure.c.
>
> Keep the declarations private to mm/.
>
> No functional change.
>
> Suggested-by: Mike Rapoport <rppt@xxxxxxxxxx>
> Link: https://lore.kernel.org/all/aumt-4kfGGtoXuh-@xxxxxxxxxx/
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
> ---
> MAINTAINERS | 1 +
> mm/hwpoison-inject.c | 1 +
> mm/internal.h | 29 -----------------------------
> mm/ksm.c | 1 +
> mm/memory-failure.c | 1 +
> mm/memory-failure.h | 36 ++++++++++++++++++++++++++++++++++++
> mm/memory_hotplug.c | 1 +
> mm/page_alloc.c | 1 +
> mm/page_vma_mapped.c | 1 +
> mm/vmscan.c | 1 +
> 10 files changed, 44 insertions(+), 29 deletions(-)
>
Makes sense. Thanks.
Acked-by: Zi Yan <ziy@xxxxxxxxxx>
Best Regards,
Yan, Zi