Linux 6.9-rc5
[sfrench/cifs-2.6.git] / arch / x86 / mm / highmem_32.c
1 // SPDX-License-Identifier: GPL-2.0-only
2 #include <linux/highmem.h>
3 #include <linux/export.h>
4 #include <linux/swap.h> /* for totalram_pages */
5 #include <linux/memblock.h>
6
7 void __init set_highmem_pages_init(void)
8 {
9         struct zone *zone;
10         int nid;
11
12         /*
13          * Explicitly reset zone->managed_pages because set_highmem_pages_init()
14          * is invoked before memblock_free_all()
15          */
16         reset_all_zones_managed_pages();
17         for_each_zone(zone) {
18                 unsigned long zone_start_pfn, zone_end_pfn;
19
20                 if (!is_highmem(zone))
21                         continue;
22
23                 zone_start_pfn = zone->zone_start_pfn;
24                 zone_end_pfn = zone_start_pfn + zone->spanned_pages;
25
26                 nid = zone_to_nid(zone);
27                 printk(KERN_INFO "Initializing %s for node %d (%08lx:%08lx)\n",
28                                 zone->name, nid, zone_start_pfn, zone_end_pfn);
29
30                 add_highpages_with_active_regions(nid, zone_start_pfn,
31                                  zone_end_pfn);
32         }
33 }