From: Andrew Morton <akpm@linux-foundation.org>
To: ionut.nechita@windriver.com
Cc: bugzilla-daemon@kernel.org, linux-mm@kvack.org,
Mike Rapoport <rppt@kernel.org>,
Frederic Weisbecker <frederic@kernel.org>
Subject: Re: [Bug 221804] New: WARNING at mm/memblock.c:904 __free_reserved_area(): "Cannot free reserved memory because of deferred initialization of the memory map" during housekeeping_init() at boot
Date: Tue, 28 Jul 2026 13:40:16 -0700 [thread overview]
Message-ID: <20260728134016.674388f101f141362598240f@linux-foundation.org> (raw)
In-Reply-To: <bug-221804-27@https.bugzilla.kernel.org/>
(switched to email. Please respond via emailed reply-to-all, not via the
bugzilla web interface).
On Tue, 28 Jul 2026 15:52:54 +0000 bugzilla-daemon@kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=221804
>
> Bug ID: 221804
> Summary: WARNING at mm/memblock.c:904 __free_reserved_area():
> "Cannot free reserved memory because of deferred
> initialization of the memory map" during
> housekeeping_init() at boot
> Product: Memory Management
> Version: 2.5
> Hardware: All
> OS: Linux
> Status: NEW
> Severity: normal
> Priority: P3
> Component: Other
> Assignee: akpm@linux-foundation.org
> Reporter: ionut.nechita@windriver.com
> Regression: No
>
> Hello Kernel Team,
>
> I notice this today:
>
> ...
> [ 0.075447] Dynamic Preempt: lazy
> [ 0.075489] ------------[ cut here ]------------
> [ 0.075490] Cannot free reserved memory because of deferred initialization
> of the memory map
Thanks. I asked Gemini "what happened here" and the response was
illuminating.
The bottom lines:
The Core Issue: Initialization Order Conflict
The kernel hit an order-of-operations conflict between memory setup
and kernel parameter parsing:
CONFIG_DEFERRED_STRUCT_PAGE_INIT=y delays initializing struct page
tracking structures for large pools of RAM until secondary CPUs come
online (to speed up boot times on large systems).
housekeeping_init() runs very early during start_kernel(). It
parses CPU isolation/housekeeping flags (isolcpus=, nohz_full=,
rcu_nocbs=) and allocates temporary cpumask buffers in memblock.
Once parsed, it tries to free those temporary buffers back to the
memory pool using memblock_phys_free().
The Collision: memblock_phys_free() calls __free_reserved_area(),
which requires valid struct page mappings. Because page
initialization was deferred, __free_reserved_area() detects that the
target memory's struct page maps aren't ready yet (at time 0.075s,
whereas deferred init only finished around 0.325s).
As a safeguard, __free_reserved_area() issues a WARN() and refuses to
free the pages.
Fix/Workaround:
Fix the nohz_full syntax on the command line (e.g.,
nohz_full=8-55,64-111).
To eliminate the warning entirely until fixed upstream, boot with
deferred_init=off as a kernel parameter or disable
CONFIG_DEFERRED_STRUCT_PAGE_INIT in the kernel build. Upstream,
housekeeping_init() should either avoid early memblock freeing or use
allocations that don't depend on fully initialized page maps.
I don't think this is very high priority.
next parent reply other threads:[~2026-07-28 20:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-221804-27@https.bugzilla.kernel.org/>
2026-07-28 20:40 ` Andrew Morton [this message]
2026-07-29 5:50 ` [Bug 221804] New: WARNING at mm/memblock.c:904 __free_reserved_area(): "Cannot free reserved memory because of deferred initialization of the memory map" during housekeeping_init() at boot Mike Rapoport
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260728134016.674388f101f141362598240f@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=bugzilla-daemon@kernel.org \
--cc=frederic@kernel.org \
--cc=ionut.nechita@windriver.com \
--cc=linux-mm@kvack.org \
--cc=rppt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox