Re: [PATCH] mm: split out memory-failure declarations from internal.h

From: Mike Rapoport

Date: Thu Nov 05 2026 - 02:38:42 EST


On Wed, Nov 04, 2026 at 08:45:34AM -0800, 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>

Acked-by: Mike Rapoport (Microsoft) <rppt@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(-)

--
Sincerely yours,
Mike.