From: Mike Rapoport <rppt@kernel.org>
To: Hou Wenlong <houwenlong.hwl@antgroup.com>
Cc: linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Vlastimil Babka <vbabka@suse.cz>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
linux-mm@kvack.org
Subject: Re: [PATCH mm-new] mm/early_ioremap: Clean up the use of WARN() for debugging
Date: Mon, 12 Jan 2026 18:00:20 +0200 [thread overview]
Message-ID: <aWUalAtwkLgLNt3F@kernel.org> (raw)
In-Reply-To: <d4470531ce0c03fd80f9a1be7e8d8ae1bc60fcd1.1768220636.git.houwenlong.hwl@antgroup.com>
On Mon, Jan 12, 2026 at 08:24:29PM +0800, Hou Wenlong wrote:
> Using WARN() for debugging is strange when nothing is wrong, so replace
> WARN(early_ioremap_debug) with pr_warn() + dump_stack().
>
> Suggested-by: Mike Rapoport <rppt@kernel.org>
> Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
> mm/early_ioremap.c | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c
> index 3fdde074c9da..96c29b9dc85d 100644
> --- a/mm/early_ioremap.c
> +++ b/mm/early_ioremap.c
> @@ -30,6 +30,14 @@ static int __init early_ioremap_debug_setup(char *str)
> }
> early_param("early_ioremap_debug", early_ioremap_debug_setup);
>
> +#define early_ioremap_dbg(fmt, args...) \
> + do { \
> + if (unlikely(early_ioremap_debug)) { \
> + pr_warn(fmt, ##args); \
> + dump_stack(); \
> + } \
> + } while (0)
> +
> static int after_paging_init __initdata;
>
> pgprot_t __init __weak early_memremap_pgprot_adjust(resource_size_t phys_addr,
> @@ -139,8 +147,8 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
> if (WARN_ON(nrpages > NR_FIX_BTMAPS))
> return NULL;
>
> - WARN(early_ioremap_debug, "%s(%pa, %08lx) [%d] => %08lx + %08lx\n",
> - __func__, &phys_addr, size, slot, slot_virt[slot], offset);
> + early_ioremap_dbg("%s(%pa, %08lx) [%d] => %08lx + %08lx\n",
> + __func__, &phys_addr, size, slot, slot_virt[slot], offset);
>
> /*
> * Ok, go for it..
> @@ -185,8 +193,7 @@ void __init early_iounmap(void __iomem *addr, unsigned long size)
> __func__, addr, size, slot, prev_size[slot]))
> return;
>
> - WARN(early_ioremap_debug, "%s(%p, %08lx) [%d]\n",
> - __func__, addr, size, slot);
> + early_ioremap_dbg("%s(%p, %08lx) [%d]\n", __func__, addr, size, slot);
>
> virt_addr = (unsigned long)addr;
> if (WARN_ON(virt_addr < fix_to_virt(FIX_BTMAP_BEGIN)))
>
> base-commit: ab3d40bdac831c67e130fda12f3011505556500f
> --
> 2.31.1
>
--
Sincerely yours,
Mike.
prev parent reply other threads:[~2026-01-12 16:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-12 12:24 Hou Wenlong
2026-01-12 16:00 ` Mike Rapoport [this message]
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=aWUalAtwkLgLNt3F@kernel.org \
--to=rppt@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=houwenlong.hwl@antgroup.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
/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