Message ID | 20210811134139.5451-1-rppt@kernel.org |
---|---|
State | New |
Headers | show |
Series | [5.10] mm: make zone_to_nid() and zone_set_nid() available for DISCONTIGMEM | expand |
On Wed, Aug 11, 2021 at 04:41:39PM +0300, Mike Rapoport wrote: > From: Mike Rapoport <rppt@linux.ibm.com> > > Since the commit ce6ee46e0f39 ("mm/page_alloc: fix memory map > initialization for descending nodes") initialization of the memory map > relies on availability of zone_to_nid() and zone_set_nid methods to link > struct page to a node. > > But in 5.10 zone_to_nid() is only defined for NUMA, but not for > DISCONTIGMEM which causes crashes on m68k systems with two memory banks. > Many thanks for the work done to figure this out and fix it. Now queued up. greg k-h
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 9d0c454d23cd..63b550403317 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -445,7 +445,7 @@ struct zone { */ long lowmem_reserve[MAX_NR_ZONES]; -#ifdef CONFIG_NUMA +#ifdef CONFIG_NEED_MULTIPLE_NODES int node; #endif struct pglist_data *zone_pgdat; @@ -896,7 +896,7 @@ static inline bool populated_zone(struct zone *zone) return zone->present_pages; } -#ifdef CONFIG_NUMA +#ifdef CONFIG_NEED_MULTIPLE_NODES static inline int zone_to_nid(struct zone *zone) { return zone->node;