@@ -2374,12 +2374,16 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
23742374 */
23752375 if (global_reclaim (sc )) {
23762376 unsigned long lru_pages = 0 ;
2377+
2378+ nodes_clear (shrink -> nodes_to_scan );
23772379 for_each_zone_zonelist (zone , z , zonelist ,
23782380 gfp_zone (sc -> gfp_mask )) {
23792381 if (!cpuset_zone_allowed_hardwall (zone , GFP_KERNEL ))
23802382 continue ;
23812383
23822384 lru_pages += zone_reclaimable_pages (zone );
2385+ node_set (zone_to_nid (zone ),
2386+ shrink -> nodes_to_scan );
23832387 }
23842388
23852389 shrink_slab (shrink , sc -> nr_scanned , lru_pages );
@@ -2836,6 +2840,8 @@ static bool kswapd_shrink_zone(struct zone *zone,
28362840 return true;
28372841
28382842 shrink_zone (zone , sc );
2843+ nodes_clear (shrink .nodes_to_scan );
2844+ node_set (zone_to_nid (zone ), shrink .nodes_to_scan );
28392845
28402846 reclaim_state -> reclaimed_slab = 0 ;
28412847 nr_slab = shrink_slab (& shrink , sc -> nr_scanned , lru_pages );
@@ -3544,10 +3550,9 @@ static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
35443550 * number of slab pages and shake the slab until it is reduced
35453551 * by the same nr_pages that we used for reclaiming unmapped
35463552 * pages.
3547- *
3548- * Note that shrink_slab will free memory on all zones and may
3549- * take a long time.
35503553 */
3554+ nodes_clear (shrink .nodes_to_scan );
3555+ node_set (zone_to_nid (zone ), shrink .nodes_to_scan );
35513556 for (;;) {
35523557 unsigned long lru_pages = zone_reclaimable_pages (zone );
35533558
0 commit comments