lkml.org 
[lkml]   [2021]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH v2 2/9] mm/memory_hotplug: introduce "auto-movable" online policy
From
Date
> 
> +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

\
 
 \ /
  Last update: 2021-07-26 09:17    [W:0.135 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site