@@ -1968,7 +1968,7 @@ static enum compact_result compact_finished(struct compact_control *cc)
19681968 */
19691969static enum compact_result __compaction_suitable (struct zone * zone , int order ,
19701970 unsigned int alloc_flags ,
1971- int classzone_idx ,
1971+ int highest_zoneidx ,
19721972 unsigned long wmark_target )
19731973{
19741974 unsigned long watermark ;
@@ -1981,7 +1981,7 @@ static enum compact_result __compaction_suitable(struct zone *zone, int order,
19811981 * If watermarks for high-order allocation are already met, there
19821982 * should be no need for compaction at all.
19831983 */
1984- if (zone_watermark_ok (zone , order , watermark , classzone_idx ,
1984+ if (zone_watermark_ok (zone , order , watermark , highest_zoneidx ,
19851985 alloc_flags ))
19861986 return COMPACT_SUCCESS ;
19871987
@@ -1991,9 +1991,9 @@ static enum compact_result __compaction_suitable(struct zone *zone, int order,
19911991 * watermark and alloc_flags have to match, or be more pessimistic than
19921992 * the check in __isolate_free_page(). We don't use the direct
19931993 * compactor's alloc_flags, as they are not relevant for freepage
1994- * isolation. We however do use the direct compactor's classzone_idx to
1995- * skip over zones where lowmem reserves would prevent allocation even
1996- * if compaction succeeds.
1994+ * isolation. We however do use the direct compactor's highest_zoneidx
1995+ * to skip over zones where lowmem reserves would prevent allocation
1996+ * even if compaction succeeds.
19971997 * For costly orders, we require low watermark instead of min for
19981998 * compaction to proceed to increase its chances.
19991999 * ALLOC_CMA is used, as pages in CMA pageblocks are considered
@@ -2002,7 +2002,7 @@ static enum compact_result __compaction_suitable(struct zone *zone, int order,
20022002 watermark = (order > PAGE_ALLOC_COSTLY_ORDER ) ?
20032003 low_wmark_pages (zone ) : min_wmark_pages (zone );
20042004 watermark += compact_gap (order );
2005- if (!__zone_watermark_ok (zone , 0 , watermark , classzone_idx ,
2005+ if (!__zone_watermark_ok (zone , 0 , watermark , highest_zoneidx ,
20062006 ALLOC_CMA , wmark_target ))
20072007 return COMPACT_SKIPPED ;
20082008
@@ -2011,12 +2011,12 @@ static enum compact_result __compaction_suitable(struct zone *zone, int order,
20112011
20122012enum compact_result compaction_suitable (struct zone * zone , int order ,
20132013 unsigned int alloc_flags ,
2014- int classzone_idx )
2014+ int highest_zoneidx )
20152015{
20162016 enum compact_result ret ;
20172017 int fragindex ;
20182018
2019- ret = __compaction_suitable (zone , order , alloc_flags , classzone_idx ,
2019+ ret = __compaction_suitable (zone , order , alloc_flags , highest_zoneidx ,
20202020 zone_page_state (zone , NR_FREE_PAGES ));
20212021 /*
20222022 * fragmentation index determines if allocation failures are due to
@@ -2057,8 +2057,8 @@ bool compaction_zonelist_suitable(struct alloc_context *ac, int order,
20572057 * Make sure at least one zone would pass __compaction_suitable if we continue
20582058 * retrying the reclaim.
20592059 */
2060- for_each_zone_zonelist_nodemask (zone , z , ac -> zonelist , ac -> high_zoneidx ,
2061- ac -> nodemask ) {
2060+ for_each_zone_zonelist_nodemask (zone , z , ac -> zonelist ,
2061+ ac -> highest_zoneidx , ac -> nodemask ) {
20622062 unsigned long available ;
20632063 enum compact_result compact_result ;
20642064
@@ -2071,7 +2071,7 @@ bool compaction_zonelist_suitable(struct alloc_context *ac, int order,
20712071 available = zone_reclaimable_pages (zone ) / order ;
20722072 available += zone_page_state_snapshot (zone , NR_FREE_PAGES );
20732073 compact_result = __compaction_suitable (zone , order , alloc_flags ,
2074- ac_classzone_idx ( ac ) , available );
2074+ ac -> highest_zoneidx , available );
20752075 if (compact_result != COMPACT_SKIPPED )
20762076 return true;
20772077 }
@@ -2102,7 +2102,7 @@ compact_zone(struct compact_control *cc, struct capture_control *capc)
21022102
21032103 cc -> migratetype = gfpflags_to_migratetype (cc -> gfp_mask );
21042104 ret = compaction_suitable (cc -> zone , cc -> order , cc -> alloc_flags ,
2105- cc -> classzone_idx );
2105+ cc -> highest_zoneidx );
21062106 /* Compaction is likely to fail */
21072107 if (ret == COMPACT_SUCCESS || ret == COMPACT_SKIPPED )
21082108 return ret ;
@@ -2293,7 +2293,7 @@ compact_zone(struct compact_control *cc, struct capture_control *capc)
22932293
22942294static enum compact_result compact_zone_order (struct zone * zone , int order ,
22952295 gfp_t gfp_mask , enum compact_priority prio ,
2296- unsigned int alloc_flags , int classzone_idx ,
2296+ unsigned int alloc_flags , int highest_zoneidx ,
22972297 struct page * * capture )
22982298{
22992299 enum compact_result ret ;
@@ -2305,7 +2305,7 @@ static enum compact_result compact_zone_order(struct zone *zone, int order,
23052305 .mode = (prio == COMPACT_PRIO_ASYNC ) ?
23062306 MIGRATE_ASYNC : MIGRATE_SYNC_LIGHT ,
23072307 .alloc_flags = alloc_flags ,
2308- .classzone_idx = classzone_idx ,
2308+ .highest_zoneidx = highest_zoneidx ,
23092309 .direct_compaction = true,
23102310 .whole_zone = (prio == MIN_COMPACT_PRIORITY ),
23112311 .ignore_skip_hint = (prio == MIN_COMPACT_PRIORITY ),
@@ -2361,8 +2361,8 @@ enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
23612361 trace_mm_compaction_try_to_compact_pages (order , gfp_mask , prio );
23622362
23632363 /* Compact each zone in the list */
2364- for_each_zone_zonelist_nodemask (zone , z , ac -> zonelist , ac -> high_zoneidx ,
2365- ac -> nodemask ) {
2364+ for_each_zone_zonelist_nodemask (zone , z , ac -> zonelist ,
2365+ ac -> highest_zoneidx , ac -> nodemask ) {
23662366 enum compact_result status ;
23672367
23682368 if (prio > MIN_COMPACT_PRIORITY
@@ -2372,7 +2372,7 @@ enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
23722372 }
23732373
23742374 status = compact_zone_order (zone , order , gfp_mask , prio ,
2375- alloc_flags , ac_classzone_idx ( ac ) , capture );
2375+ alloc_flags , ac -> highest_zoneidx , capture );
23762376 rc = max (status , rc );
23772377
23782378 /* The allocation should succeed, stop compacting */
@@ -2507,16 +2507,16 @@ static bool kcompactd_node_suitable(pg_data_t *pgdat)
25072507{
25082508 int zoneid ;
25092509 struct zone * zone ;
2510- enum zone_type classzone_idx = pgdat -> kcompactd_classzone_idx ;
2510+ enum zone_type highest_zoneidx = pgdat -> kcompactd_highest_zoneidx ;
25112511
2512- for (zoneid = 0 ; zoneid <= classzone_idx ; zoneid ++ ) {
2512+ for (zoneid = 0 ; zoneid <= highest_zoneidx ; zoneid ++ ) {
25132513 zone = & pgdat -> node_zones [zoneid ];
25142514
25152515 if (!populated_zone (zone ))
25162516 continue ;
25172517
25182518 if (compaction_suitable (zone , pgdat -> kcompactd_max_order , 0 ,
2519- classzone_idx ) == COMPACT_CONTINUE )
2519+ highest_zoneidx ) == COMPACT_CONTINUE )
25202520 return true;
25212521 }
25222522
@@ -2534,16 +2534,16 @@ static void kcompactd_do_work(pg_data_t *pgdat)
25342534 struct compact_control cc = {
25352535 .order = pgdat -> kcompactd_max_order ,
25362536 .search_order = pgdat -> kcompactd_max_order ,
2537- .classzone_idx = pgdat -> kcompactd_classzone_idx ,
2537+ .highest_zoneidx = pgdat -> kcompactd_highest_zoneidx ,
25382538 .mode = MIGRATE_SYNC_LIGHT ,
25392539 .ignore_skip_hint = false,
25402540 .gfp_mask = GFP_KERNEL ,
25412541 };
25422542 trace_mm_compaction_kcompactd_wake (pgdat -> node_id , cc .order ,
2543- cc .classzone_idx );
2543+ cc .highest_zoneidx );
25442544 count_compact_event (KCOMPACTD_WAKE );
25452545
2546- for (zoneid = 0 ; zoneid <= cc .classzone_idx ; zoneid ++ ) {
2546+ for (zoneid = 0 ; zoneid <= cc .highest_zoneidx ; zoneid ++ ) {
25472547 int status ;
25482548
25492549 zone = & pgdat -> node_zones [zoneid ];
@@ -2592,25 +2592,25 @@ static void kcompactd_do_work(pg_data_t *pgdat)
25922592
25932593 /*
25942594 * Regardless of success, we are done until woken up next. But remember
2595- * the requested order/classzone_idx in case it was higher/tighter than
2596- * our current ones
2595+ * the requested order/highest_zoneidx in case it was higher/tighter
2596+ * than our current ones
25972597 */
25982598 if (pgdat -> kcompactd_max_order <= cc .order )
25992599 pgdat -> kcompactd_max_order = 0 ;
2600- if (pgdat -> kcompactd_classzone_idx >= cc .classzone_idx )
2601- pgdat -> kcompactd_classzone_idx = pgdat -> nr_zones - 1 ;
2600+ if (pgdat -> kcompactd_highest_zoneidx >= cc .highest_zoneidx )
2601+ pgdat -> kcompactd_highest_zoneidx = pgdat -> nr_zones - 1 ;
26022602}
26032603
2604- void wakeup_kcompactd (pg_data_t * pgdat , int order , int classzone_idx )
2604+ void wakeup_kcompactd (pg_data_t * pgdat , int order , int highest_zoneidx )
26052605{
26062606 if (!order )
26072607 return ;
26082608
26092609 if (pgdat -> kcompactd_max_order < order )
26102610 pgdat -> kcompactd_max_order = order ;
26112611
2612- if (pgdat -> kcompactd_classzone_idx > classzone_idx )
2613- pgdat -> kcompactd_classzone_idx = classzone_idx ;
2612+ if (pgdat -> kcompactd_highest_zoneidx > highest_zoneidx )
2613+ pgdat -> kcompactd_highest_zoneidx = highest_zoneidx ;
26142614
26152615 /*
26162616 * Pairs with implicit barrier in wait_event_freezable()
@@ -2623,7 +2623,7 @@ void wakeup_kcompactd(pg_data_t *pgdat, int order, int classzone_idx)
26232623 return ;
26242624
26252625 trace_mm_compaction_wakeup_kcompactd (pgdat -> node_id , order ,
2626- classzone_idx );
2626+ highest_zoneidx );
26272627 wake_up_interruptible (& pgdat -> kcompactd_wait );
26282628}
26292629
@@ -2644,7 +2644,7 @@ static int kcompactd(void *p)
26442644 set_freezable ();
26452645
26462646 pgdat -> kcompactd_max_order = 0 ;
2647- pgdat -> kcompactd_classzone_idx = pgdat -> nr_zones - 1 ;
2647+ pgdat -> kcompactd_highest_zoneidx = pgdat -> nr_zones - 1 ;
26482648
26492649 while (!kthread_should_stop ()) {
26502650 unsigned long pflags ;
0 commit comments