[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cd67a188-6d87-2d99-cfb8-2c4964e6087e@redhat.com>
Date: Mon, 26 Jul 2021 09:15:35 +0200
From: David Hildenbrand <david@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Marek Kedzierski <mkedzier@...hat.com>,
Hui Zhu <teawater@...il.com>,
Pankaj Gupta <pankaj.gupta.linux@...il.com>,
Wei Yang <richard.weiyang@...ux.alibaba.com>,
Oscar Salvador <osalvador@...e.de>,
Michal Hocko <mhocko@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Anshuman Khandual <anshuman.khandual@....com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Vlastimil Babka <vbabka@...e.cz>,
Mike Rapoport <rppt@...nel.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <lenb@...nel.org>,
Pavel Tatashin <pasha.tatashin@...een.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
virtualization@...ts.linux-foundation.org,
linux-acpi@...r.kernel.org
Subject: Re: [PATCH v2 2/9] mm/memory_hotplug: introduce "auto-movable" online
policy
>
> +struct auto_movable_stats {
> + unsigned long kernel_early_pages;
> + unsigned long movable_pages;
> +};
> +
> +static void auto_movable_stats_account_zone(struct auto_movable_stats *stats,
> + struct zone *zone)
> +{
> + if (zone_idx(zone) == ZONE_MOVABLE) {
> + stats->movable_pages += zone->present_pages;
> + } else {
> + /*
> + * CMA pages (never on hotplugged memory) behave like
> + * ZONE_MOVABLE.
> + */
> + stats->movable_pages += zone->cma_pages;
> + stats->kernel_early_pages += zone->present_early_pages;
> + stats->kernel_early_pages -= zone->cma_pages;
> + }
> +}
The following on top to make it compile without CONFIG_CMA (thanks Randy):
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index bfdaa28eb86f..fa1a0afd32ba 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -741,13 +741,15 @@ static void auto_movable_stats_account_zone(struct auto_movable_stats *stats,
if (zone_idx(zone) == ZONE_MOVABLE) {
stats->movable_pages += zone->present_pages;
} else {
+ stats->kernel_early_pages += zone->present_early_pages;
+#ifdef CONFIG_CMA
/*
* CMA pages (never on hotplugged memory) behave like
* ZONE_MOVABLE.
*/
stats->movable_pages += zone->cma_pages;
- stats->kernel_early_pages += zone->present_early_pages;
stats->kernel_early_pages -= zone->cma_pages;
+#endif /* CONFIG_CMA */
}
}
struct auto_movable_group_stats {
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists