@@ -2140,7 +2140,7 @@ static int __init deferred_init_memmap(void *data)
2140
2140
unsigned long first_init_pfn , flags ;
2141
2141
unsigned long start = jiffies ;
2142
2142
struct zone * zone ;
2143
- int zid , max_threads ;
2143
+ int max_threads ;
2144
2144
u64 i ;
2145
2145
2146
2146
/* Bind memory initialisation thread to a local node if possible */
@@ -2167,12 +2167,8 @@ static int __init deferred_init_memmap(void *data)
2167
2167
*/
2168
2168
pgdat_resize_unlock (pgdat , & flags );
2169
2169
2170
- /* Only the highest zone is deferred so find it */
2171
- for (zid = 0 ; zid < MAX_NR_ZONES ; zid ++ ) {
2172
- zone = pgdat -> node_zones + zid ;
2173
- if (first_init_pfn < zone_end_pfn (zone ))
2174
- break ;
2175
- }
2170
+ /* Only the highest zone is deferred */
2171
+ zone = pgdat -> node_zones + pgdat -> nr_zones - 1 ;
2176
2172
2177
2173
/* If the zone is empty somebody else may have cleared out the zone */
2178
2174
if (!deferred_init_mem_pfn_range_in_zone (& i , zone , & spfn , & epfn ,
@@ -2200,7 +2196,7 @@ static int __init deferred_init_memmap(void *data)
2200
2196
}
2201
2197
zone_empty :
2202
2198
/* Sanity check that the next zone really is unpopulated */
2203
- WARN_ON (++ zid < MAX_NR_ZONES && populated_zone (++ zone ));
2199
+ WARN_ON (pgdat -> nr_zones < MAX_NR_ZONES && populated_zone (++ zone ));
2204
2200
2205
2201
pr_info ("node %d deferred pages initialised in %ums\n" ,
2206
2202
pgdat -> node_id , jiffies_to_msecs (jiffies - start ));
0 commit comments