From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Zhenhua Huang <quic_zhenhuah@quicinc.com>,
Catalin Marinas <catalin.marinas@arm.com>
Cc: will@kernel.org, ardb@kernel.org, ryan.roberts@arm.com,
mark.rutland@arm.com, joey.gouly@arm.com,
dave.hansen@linux.intel.com, akpm@linux-foundation.org,
chenfeiyang@loongson.cn, chenhuacai@kernel.org,
linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, quic_tingweiz@quicinc.com,
stable@vger.kernel.org
Subject: Re: [PATCH v4] arm64: mm: Populate vmemmap/linear at the page level for hotplugged sections
Date: Wed, 8 Jan 2025 16:22:15 +0530 [thread overview]
Message-ID: <1c1504a7-3515-48f2-8ca7-15b2379dea22@arm.com> (raw)
In-Reply-To: <406d5113-ff3d-4c2a-81f0-de791bcbeffb@quicinc.com>
On 1/8/25 15:37, Zhenhua Huang wrote:
>
>>
>>> /*
>>> @@ -1175,9 +1178,21 @@ int __meminit vmemmap_check_pmd(pmd_t *pmdp, int node,
>>> int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
>>> struct vmem_altmap *altmap)
>>> {
>>> + unsigned long start_pfn;
>>> + struct mem_section *ms;
>>> +
>>> WARN_ON((start < VMEMMAP_START) || (end > VMEMMAP_END));
>>> - if (!IS_ENABLED(CONFIG_ARM64_4K_PAGES))
>>> + start_pfn = page_to_pfn((struct page *)start);
>>> + ms = __pfn_to_section(start_pfn);
>>
>> Hmm, it would have been better if the core code provided the start pfn
>> as it does for vmemmap_populate_compound_pages() but I'm fine with
>> deducting it from 'start'.
>
> I found another bug, that even for early section, when vmemmap_populate is called, SECTION_IS_EARLY is not set. Therefore, early_section() always return false.
Hmm, well that's unexpected.
>
> Since vmemmap_populate() occurs during section initialization, it may be hard to say it is a bug..
> However, should we instead using SECTION_MARKED_PRESENT to check? I tested well in my setup.
>
> Hot plug flow:
> 1. section_activate -> vmemmap_populate
> 2. mark PRESENT
>
> In contrast, the early flow:
> 1. memblocks_present -> mark PRESENT
> 2. __populate_section_memmap -> vmemmap_populate
But from a semantics perspective, should SECTION_MARKED_PRESENT be marked on a
section before SECTION_IS_EARLY ? Is it really the expected behaviour here or
that needs to be fixed first ?
Although SYSTEM_BOOTING state check might help but section flag seems to be the
right thing to do here.
next prev parent reply other threads:[~2025-01-08 10:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 7:42 Zhenhua Huang
2025-01-07 19:22 ` Catalin Marinas
2025-01-08 10:07 ` Zhenhua Huang
2025-01-08 10:52 ` Anshuman Khandual [this message]
2025-01-09 7:04 ` Zhenhua Huang
2025-01-09 14:32 ` Catalin Marinas
2025-01-10 3:13 ` Zhenhua Huang
2025-01-08 10:11 ` Anshuman Khandual
2025-01-09 7:04 ` Zhenhua Huang
2025-01-09 12:10 ` Catalin Marinas
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=1c1504a7-3515-48f2-8ca7-15b2379dea22@arm.com \
--to=anshuman.khandual@arm.com \
--cc=akpm@linux-foundation.org \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=chenfeiyang@loongson.cn \
--cc=chenhuacai@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=joey.gouly@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mark.rutland@arm.com \
--cc=quic_tingweiz@quicinc.com \
--cc=quic_zhenhuah@quicinc.com \
--cc=ryan.roberts@arm.com \
--cc=stable@vger.kernel.org \
--cc=will@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