From: Muchun Song <muchun.song@linux.dev>
To: Lance Yang <lance.yang@linux.dev>
Cc: dave.hansen@linux.intel.com, luto@kernel.org,
peterz@infradead.org, tglx@kernel.org, mingo@redhat.com,
bp@alien8.de, x86@kernel.org, hpa@zytor.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
david@kernel.org
Subject: Re: [PATCH 1/1] x86/mm: fix spurious warning on __add_pages() failure
Date: Thu, 1 Oct 2026 17:12:37 +0800 [thread overview]
Message-ID: <A0683ED1-1E2B-4FA5-A045-4D984ACB2762@linux.dev> (raw)
In-Reply-To: <20261001081555.35485-1-lance.yang@linux.dev>
> On Oct 1, 2026, at 16:15, Lance Yang <lance.yang@linux.dev> wrote:
>
> __add_pages() can fail if we run out of memory. The caller already
> handles that, so we shouldn't WARN_ON_ONCE() just because an allocation
> failed.
>
> Let's return the error instead, and only update the end-of-memory
> variables after __add_pages() succeeds.
>
> Fixes: 10f22dde556d ("x86: arch/x86/mm/init_64.c printk fixes")
> Reported-by: David Hildenbrand <david@kernel.org>
> Link: https://lore.kernel.org/all/d4fac8af-fd71-47a2-bfe9-3c6559b92209@kernel.org/
> Suggested-by: Muchun Song <muchun.song@linux.dev>
> Link: https://lore.kernel.org/all/203892F4-B04A-4F69-A1B3-DC1619176C67@linux.dev/
> Signed-off-by: Lance Yang <lance.yang@linux.dev>
I noticed that __add_pages() already reports invalid parameters where
appropriate, while errors such as -ENOMEM can legitimately occur and
are propagated to the caller. Therefore, the additional
WARN_ON_ONCE(ret) in add_pages() seems unnecessary to me.
The change looks reasonable.
Acked-by: Muchun Song <muchun.song@linux.dev>
next prev parent reply other threads:[~2026-10-01 9:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 8:15 Lance Yang
2026-10-01 9:12 ` Muchun Song [this message]
2026-10-01 9:43 ` David Hildenbrand (Arm)
2026-10-01 12:08 ` [tip: x86/mm] x86/mm: Fix " tip-bot2 for Lance Yang
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=A0683ED1-1E2B-4FA5-A045-4D984ACB2762@linux.dev \
--to=muchun.song@linux.dev \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david@kernel.org \
--cc=hpa@zytor.com \
--cc=lance.yang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@kernel.org \
--cc=x86@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
all inboxes | Powered by JetHome®