On Wed, Jun 22, 2016 at 04:42:06PM +0800, Hillf Danton wrote: > > /* > > - * If a zone reaches its high watermark, consider it to be no longer > > - * congested. It's possible there are dirty pages backed by congested > > - * BDIs but as pressure is relieved, speculatively avoid congestion > > - * waits. > > + * Fragmentation may mean that the system cannot be rebalanced for > > + * high-order allocations. If twice the allocation size has been > > + * reclaimed then recheck watermarks only at order-0 to prevent > > + * excessive reclaim. Assume that a process requested a high-order > > + * can direct reclaim/compact. > > */ > > - if (pgdat_reclaimable(zone->zone_pgdat) && > > - zone_balanced(zone, sc->order, false, 0, classzone_idx)) { > > - clear_bit(PGDAT_CONGESTED, &pgdat->flags); > > - clear_bit(PGDAT_DIRTY, &pgdat->flags); > > - } > > + if (sc->order && sc->nr_reclaimed >= 2UL << sc->order) > > + sc->order = 0; > > > > Reclaim order is changed here. > Btw, I find no such change in current code. > It is reintroducing a check removed by commit accf62422b3a ("mm, kswapd: replace kswapd compaction with waking up kcompactd"). That patch had kswapd always check at order-0 once kswapd is awake in pgdat_balanced but would still take at least one pass through reclaiming so kcompactd potentially makes progress. This patch removes pgdat_balanced entirely and zone_balanced() checks the order it is asked like it used to. Hence, it is necessary to reset sc->order once progress is made or kswapd potentially stays awake reclaiming pages until a high-order page is freed. -- Mel Gorman SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>