From: "Pratik R. Sampat" <prsampat@amd.com>
To: Kiryl Shutsemau <kas@kernel.org>
Cc: "David Hildenbrand (Red Hat)" <david@kernel.org>,
linux-mm@kvack.org, linux-coco@lists.linux.dev,
linux-efi@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org, tglx@linutronix.de,
mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com,
ardb@kernel.org, akpm@linux-foundation.org, osalvador@suse.de,
thomas.lendacky@amd.com, michael.roth@amd.com
Subject: Re: [RFC PATCH 2/4] mm: Add support for unaccepted memory hotplug
Date: Thu, 11 Dec 2025 16:07:34 -0600 [thread overview]
Message-ID: <b767e107-9000-49fb-a93d-40192e1f170e@amd.com> (raw)
In-Reply-To: <uc6yz23havsg2cdgtk3fgku7xr4gj2ykse7lxitcs4eh2fw4vo@hyavdm3ovdfh>
On 12/11/25 9:00 AM, Kiryl Shutsemau wrote:
> On Tue, Dec 09, 2025 at 03:36:09PM -0600, Pratik R. Sampat wrote:
>>> Agreed, I think Kiryl was hinting at pre-allocated bitmaps as well.
>>>
>>> Since, the overhead to do this upfront is fairly minimal, that should
>>> certainly simplify things and have very little to no meddling with the
>>> original EFI struct.
>>>
>>
>> Taking another look at this suggestion, I think there may be more to it
>> than I previously thought. Parsing e820 tables to know what the range
>> are for allocating the bitmap to cover hotplug may be difficult. For e.g
>>
>> [ 0.000000] efi: mem110: [Unaccepted <snip>]
>> range=[0x0000000100000000-0x000000017fffffff] (2048MB)
>> [ 0.000000] efi: mem111: [Reserved <snip>]
>> range=[0x000000fd00000000-0x000000ffffffffff] (12288MB)
>>
>> Parsing of the ACPI SRAT seems to be the one that gives us useful ranges
>> to base the upfront bitmap allocation on. e.g.
>> ...
>> [ 0.018357] ACPI: SRAT: Node 0 PXM 0 [mem 0x100000000-0x17fffffff]
>> [ 0.018781] ACPI: SRAT: Node 0 PXM 0 [mem 0x180000000-0x2ffffffff]
>> hotplug
>> This is also where max_possible_pfn gets updated to reflect this range.
>
> Do I understand correctly that EFI memory map doesn't mention hot plug
> range at all, but SRAT does?
>
> That's a mess. I thought, all hotpluggable range supposed to be declared
> in the memory map.
Not an EFI expert by a long shot, but seems so.
EFI_MEMORY_HOT_PLUGGABLE attribute does exist for hot-removable regions
of memory that must not be used for allocation during the boot context.
However, I am unclear if this in principle is also supposed to span
the entire range or just the cold-plugged regions of memory.
>
> I wounder if it is what BIOS provides, or is it result of EFI memmap
> cleanup by kernel? I see we are doing bunch of them, like in
> efi_remove_e820_mmio().
>
>> One potential solution could be to parse the SRAT during unaccepted
>> memory bitmap allocation in the EFI stub. However, this would fragment
>> the implementation by duplicating the SRAT parsing. Alternatively, we
>> could keep the current approach of dynamically allocating the bitmap on
>> hotplug or I could also replace the entire memblock_reserved unaccepted
>> table like Kiryl suggested if we must absolutely avoid changing the
>> unaccepted structure?
>
> Other possible option would be to accept all memory on hotplug and don't
> touch the bitmap at all. It might be not that bad: it doesn't block boot.
> We can think of a better solution later, if needed.
>
Absolutely, accepting memory as soon as it's added is easy.
Benchmarking it's effects may be a little tricky since unlike measuring
boot-time in eager vs lazy we may have to find representative workloads
to measure how much overheads accepting memory up-front adds.
Thanks
--Pratik
next prev parent reply other threads:[~2025-12-11 22:07 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 17:57 [RFC PATCH 0/4] SEV-SNP Unaccepted Memory Hotplug Pratik R. Sampat
2025-11-25 17:57 ` [RFC PATCH 1/4] efi/libstub: Decouple memory bitmap from the unaccepted table Pratik R. Sampat
2025-11-26 11:08 ` Kiryl Shutsemau
2025-11-26 22:27 ` Pratik R. Sampat
2025-11-27 17:29 ` Kiryl Shutsemau
2025-11-25 17:57 ` [RFC PATCH 2/4] mm: Add support for unaccepted memory hotplug Pratik R. Sampat
2025-11-26 11:12 ` Kiryl Shutsemau
2025-11-26 22:27 ` Pratik R. Sampat
2025-11-27 17:40 ` Kiryl Shutsemau
2025-11-28 9:34 ` David Hildenbrand (Red Hat)
2025-12-01 17:15 ` Pratik R. Sampat
2025-12-01 18:25 ` David Hildenbrand (Red Hat)
2025-12-01 19:35 ` Pratik R. Sampat
2025-12-01 17:15 ` Pratik R. Sampat
2025-12-01 17:48 ` Kiryl Shutsemau
2025-12-01 17:58 ` Pratik R. Sampat
2025-11-26 22:31 ` Borislav Petkov
2025-11-27 17:35 ` Kiryl Shutsemau
2025-11-27 18:12 ` Borislav Petkov
2025-11-28 9:30 ` David Hildenbrand (Red Hat)
2025-11-28 11:34 ` Borislav Petkov
2025-12-01 9:18 ` David Hildenbrand (Red Hat)
2025-12-01 11:12 ` Borislav Petkov
2025-12-01 18:32 ` David Hildenbrand (Red Hat)
2025-12-01 19:10 ` Borislav Petkov
2025-12-01 20:10 ` David Hildenbrand (Red Hat)
2025-12-01 20:25 ` Borislav Petkov
2025-12-01 20:36 ` David Hildenbrand (Red Hat)
2025-12-03 14:46 ` Kiryl Shutsemau
2025-12-03 15:58 ` Borislav Petkov
2025-12-03 15:00 ` Rik van Riel
2025-11-28 9:32 ` David Hildenbrand (Red Hat)
2025-12-01 17:21 ` Pratik R. Sampat
2025-12-01 18:36 ` David Hildenbrand (Red Hat)
2025-12-01 19:35 ` Pratik R. Sampat
2025-12-09 21:36 ` Pratik R. Sampat
2025-12-11 15:00 ` Kiryl Shutsemau
2025-12-11 22:07 ` Pratik R. Sampat [this message]
2025-11-25 17:57 ` [RFC PATCH 3/4] x86/sev: Introduce hotplug-aware SNP page state validation Pratik R. Sampat
2025-11-25 17:57 ` [RFC PATCH 4/4] mm: Add support for unaccepted memory hot-remove Pratik R. Sampat
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=b767e107-9000-49fb-a93d-40192e1f170e@amd.com \
--to=prsampat@amd.com \
--cc=akpm@linux-foundation.org \
--cc=ardb@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david@kernel.org \
--cc=kas@kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=michael.roth@amd.com \
--cc=mingo@redhat.com \
--cc=osalvador@suse.de \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--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