From: Linu Cherian <linu.cherian@arm.com>
To: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Ryan Roberts <ryan.roberts@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Anshuman Khandual <anshuman.khandual@arm.com>,
Zhenhua Huang <quic_zhenhuah@quicinc.com>,
Dev Jain <dev.jain@arm.com>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Yang Shi <yang@os.amperecomputing.com>,
Chaitanya S Prakash <chaitanyas.prakash@arm.com>
Subject: Re: [PATCH v2 1/2] arm64/mm: Allow __create_pgd_mapping() to propagate pgtable_alloc() errors
Date: Wed, 15 Oct 2025 09:52:40 +0530 [thread overview]
Message-ID: <aO8hkMtIQ0YjqTRt@a079125.arm.com> (raw)
In-Reply-To: <87f23627-d0cc-4d9a-a4f8-df1f61716b04@arm.com>
Hi Kevin,
On Tue, Oct 14, 2025 at 11:29:05AM +0200, Kevin Brodsky wrote:
> On 13/10/2025 10:02, Linu Cherian wrote:
> > [...]
> >
> > @@ -1877,23 +1926,30 @@ int arch_add_memory(int nid, u64 start, u64 size,
> > if (force_pte_mapping())
> > flags |= NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
> >
> > - __create_pgd_mapping(swapper_pg_dir, start, __phys_to_virt(start),
> > - size, params->pgprot, pgd_pgtable_alloc_init_mm,
> > - flags);
> > + ret = __create_pgd_mapping(swapper_pg_dir, start, __phys_to_virt(start),
> > + size, params->pgprot, pgd_pgtable_alloc_init_mm,
> > + flags);
> > +
>
> Nit: usually no empty line between a call and a trivial if (ret).
Ack.
>
> > + if (ret)
> > + goto out;
> >
> > memblock_clear_nomap(start, size);
> >
> > ret = __add_pages(nid, start >> PAGE_SHIFT, size >> PAGE_SHIFT,
> > params);
> > if (ret)
> > - __remove_pgd_mapping(swapper_pg_dir,
> > - __phys_to_virt(start), size);
> > + goto out;
> > else {
> > /* Address of hotplugged memory can be smaller */
> > max_pfn = max(max_pfn, PFN_UP(start + size));
> > max_low_pfn = max_pfn;
> > }
> >
> > + return 0;
> > +
> > +out:
>
> Nit: since this is an error path, it'd be clearer to call the label
> "err" rather than "out".
Ack.
Thanks,
Linu Cherian.
next prev parent reply other threads:[~2025-10-15 4:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-13 8:02 [PATCH v2 0/2] arm64/mm: prevent panic on -ENOMEM in arch_add_memory() Linu Cherian
2025-10-13 8:02 ` [PATCH v2 1/2] arm64/mm: Allow __create_pgd_mapping() to propagate pgtable_alloc() errors Linu Cherian
2025-10-13 9:26 ` Ryan Roberts
2025-10-15 4:21 ` Linu Cherian
2025-10-14 9:29 ` Kevin Brodsky
2025-10-15 4:22 ` Linu Cherian [this message]
2025-10-13 8:02 ` [PATCH v2 2/2] arm64/mm: Rename try_pgd_pgtable_alloc_init_mm Linu Cherian
2025-10-13 9:30 ` Ryan Roberts
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=aO8hkMtIQ0YjqTRt@a079125.arm.com \
--to=linu.cherian@arm.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=chaitanyas.prakash@arm.com \
--cc=dev.jain@arm.com \
--cc=kevin.brodsky@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=quic_zhenhuah@quicinc.com \
--cc=ryan.roberts@arm.com \
--cc=will@kernel.org \
--cc=yang@os.amperecomputing.com \
/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®