[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <830c1670-378b-0fb6-bd5e-208e545fa126@redhat.com>
Date: Wed, 29 Sep 2021 18:54:01 +0200
From: David Hildenbrand <david@...hat.com>
To: Mike Rapoport <rppt@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.com>,
Oscar Salvador <osalvador@...e.de>,
Jianyong Wu <Jianyong.Wu@....com>,
"Aneesh Kumar K . V" <aneesh.kumar@...ux.ibm.com>,
Vineet Gupta <vgupta@...nel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Huacai Chen <chenhuacai@...nel.org>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ibm.com>,
Eric Biederman <ebiederm@...ssion.com>,
Arnd Bergmann <arnd@...db.de>,
linux-snps-arc@...ts.infradead.org, linux-ia64@...r.kernel.org,
linux-m68k@...ts.linux-m68k.org, linux-mips@...r.kernel.org,
linux-s390@...r.kernel.org, linux-mm@...ck.org,
kexec@...ts.infradead.org
Subject: Re: [PATCH v1 3/4] memblock: add MEMBLOCK_DRIVER_MANAGED to mimic
IORESOURCE_SYSRAM_DRIVER_MANAGED
On 29.09.21 18:39, Mike Rapoport wrote:
> Hi,
>
> On Mon, Sep 27, 2021 at 05:05:17PM +0200, David Hildenbrand wrote:
>> Let's add a flag that corresponds to IORESOURCE_SYSRAM_DRIVER_MANAGED.
>> Similar to MEMBLOCK_HOTPLUG, most infrastructure has to treat such memory
>> like ordinary MEMBLOCK_NONE memory -- for example, when selecting memory
>> regions to add to the vmcore for dumping in the crashkernel via
>> for_each_mem_range().
>
> Can you please elaborate on the difference in semantics of MEMBLOCK_HOTPLUG
> and MEMBLOCK_DRIVER_MANAGED?
> Unless I'm missing something they both mark memory that can be unplugged
> anytime and so it should not be used in certain cases. Why is there a need
> for a new flag?
In the cover letter I have "Alternative B: Reuse MEMBLOCK_HOTPLUG.
MEMBLOCK_HOTPLUG serves a different purpose, though.", but looking into
the details it won't work as is.
MEMBLOCK_HOTPLUG is used to mark memory early during boot that can later
get hotunplugged again and should be placed into ZONE_MOVABLE if the
"movable_node" kernel parameter is set.
The confusing part is that we talk about "hotpluggable" but really mean
"hotunpluggable": the reason is that HW flags DIMM slots that can later
be hotplugged as "hotpluggable" even though there is already something
hotplugged.
For example, ranges in the ACPI SRAT that are marked as
ACPI_SRAT_MEM_HOT_PLUGGABLE will be marked MEMBLOCK_HOTPLUG early during
boot (drivers/acpi/numa/srat.c:acpi_numa_memory_affinity_init()). Later,
we use that information to size ZONE_MOVABLE
(mm/page_alloc.c:find_zone_movable_pfns_for_nodes()). This will make
sure that these "hotpluggable" DIMMs can later get hotunplugged.
Also, see should_skip_region() how this relates to the "movable_node"
kernel parameter:
/* skip hotpluggable memory regions if needed */
if (movable_node_is_enabled() && memblock_is_hotpluggable(m) &&
(flags & MEMBLOCK_HOTPLUG))
return true;
Long story short: MEMBLOCK_HOTPLUG has different semantics and is a
special case for "movable_node".
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists