On Thu, Apr 11, 2013 at 08:57:52PM +0100, Mel Gorman wrote:
> @@ -2763,7 +2769,21 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, 
> int order,
>               for (i = 0; i <= end_zone; i++) {
>                       struct zone *zone = pgdat->node_zones + i;
>  
> +                     if (!populated_zone(zone))
> +                             continue;
> +
>                       lru_pages += zone_reclaimable_pages(zone);
> +
> +                     /*
> +                      * If any zone is currently balanced then kswapd will
> +                      * not call compaction as it is expected that the
> +                      * necessary pages are already available.
> +                      */
> +                     if (pgdat_needs_compaction &&
> +                                     zone_watermark_ok(zone, order,
> +                                             low_wmark_pages(zone),
> +                                             *classzone_idx, 0))
> +                             pgdat_needs_compaction = false;
>               }
>  
>               /*
> @@ -2832,7 +2852,8 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, 
> int order,
>                                * already being scanned that high
>                                * watermark would be met at 100% efficiency.
>                                */
> -                             if (kswapd_shrink_zone(zone, &sc, lru_pages))
> +                             if (kswapd_shrink_zone(zone, &sc, lru_pages,
> +                                                    &nr_attempted))
>                                       raise_priority = false;
>                       }

There is the odd chance that the watermark is met after reclaim, would
it make sense to defer the pgdat_needs_compaction check?  Not really a
big deal, though, so:

Acked-by: Johannes Weiner <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to