@@ -86,6 +86,7 @@ struct free_area {
};
struct pglist_data;
+struct mem_region;
/*
* zone->lock and zone->lru_lock are two of the hottest locks in the kernel.
@@ -465,6 +466,8 @@ struct zone {
* Discontig memory support fields.
*/
struct pglist_data *zone_pgdat;
+ struct mem_region *zone_mem_region;
+
/* zone_start_pfn == zone_start_paddr >> PAGE_SHIFT */
unsigned long zone_start_pfn;
@@ -533,6 +536,8 @@ static inline int zone_is_oom_locked(const struct zone *zone)
return test_bit(ZONE_OOM_LOCKED, &zone->flags);
}
+#define MAX_NR_REGIONS 256
+
/*
* The "priority" of VM scanning is how much of the queues we will scan in one
* go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the
@@ -541,7 +546,7 @@ static inline int zone_is_oom_locked(const struct zone *zone)
#define DEF_PRIORITY 12
/* Maximum number of zones on a zonelist */
-#define MAX_ZONES_PER_ZONELIST (MAX_NUMNODES * MAX_NR_ZONES)
+#define MAX_ZONES_PER_ZONELIST (MAX_NUMNODES * MAX_NR_REGIONS * MAX_NR_ZONES)
#ifdef CONFIG_NUMA
@@ -671,6 +676,18 @@ struct node_active_region {
extern struct page *mem_map;
#endif
+struct mem_region {
+ struct zone region_zones[MAX_NR_ZONES];
+ int nr_region_zones;
+
+ int node;
+ int region;
+
+ unsigned long start_pfn;
+ unsigned long spanned_pages;
+};
+
+
/*
* The pg_data_t structure is used in machines with CONFIG_DISCONTIGMEM
* (mostly NUMA machines?) to denote a higher-level memory zone than the
@@ -684,9 +701,10 @@ extern struct page *mem_map;
*/
struct bootmem_data;
typedef struct pglist_data {
- struct zone node_zones[MAX_NR_ZONES];
+ struct mem_region node_regions[MAX_NR_REGIONS];
+ int nr_node_regions;
struct zonelist node_zonelists[MAX_ZONELISTS];
- int nr_zones;
+ int nr_node_zone_types;
#ifdef CONFIG_FLAT_NODE_MEM_MAP /* means !SPARSEMEM */
struct page *node_mem_map;
#ifdef CONFIG_MEMCG