[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250326152228.GA1105284@ax162>
Date: Wed, 26 Mar 2025 08:22:28 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Mike Rapoport <rppt@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Andy Lutomirski <luto@...nel.org>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>, "H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Thomas Gleixner <tglx@...utronix.de>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
kernel test robot <oliver.sang@...el.com>,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mips@...r.kernel.org, linux-mm@...ck.org, x86@...nel.org
Subject: Re: [PATCH 2/2] memblock: don't release high memory to page
allocator when HIGHMEM is off
On Tue, Mar 25, 2025 at 01:49:28PM +0200, Mike Rapoport wrote:
> From: "Mike Rapoport (Microsoft)" <rppt@...nel.org>
>
> Nathan Chancellor reports the following crash on a MIPS system with
> CONFIG_HIGHMEM=n:
...
> The crash happens because commit 6faea3422e3b ("arch, mm: streamline
> HIGHMEM freeing") too eagerly frees high memory to the page allocator even
> when HIGHMEM is disabled.
>
> Make sure that when CONFIG_HIGHMEM=n the high memory is not released to the
> page allocator.
>
> Link: https://lore.kernel.org/all/20250323190647.GA1009914@ax162
> Reported-by: Nathan Chancellor <nathan@...nel.org>
> Fixes: 6faea3422e3b ("arch, mm: streamline HIGHMEM freeing")
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@...nel.org>
Tested-by: Nathan Chancellor <nathan@...nel.org>
> ---
> mm/memblock.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 64ae678cd1d1..d7ff8dfe5f88 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -2166,6 +2166,9 @@ static unsigned long __init __free_memory_core(phys_addr_t start,
> unsigned long start_pfn = PFN_UP(start);
> unsigned long end_pfn = PFN_DOWN(end);
>
> + if (!IS_ENABLED(CONFIG_HIGHMEM) && end_pfn > max_low_pfn)
> + end_pfn = max_low_pfn;
> +
> if (start_pfn >= end_pfn)
> return 0;
>
> --
> 2.47.2
>
Powered by blists - more mailing lists