Skip to content

Commit b738d76

Browse files
committed
Don't trigger congestion wait on dirty-but-not-writeout pages
shrink_inactive_list() used to wait 0.1s to avoid congestion when all the pages that were isolated from the inactive list were dirty but not under active writeback. That makes no real sense, and apparently causes major interactivity issues under some loads since 3.11. The ostensible reason for it was to wait for kswapd to start writing pages, but that seems questionable as well, since the congestion wait code seems to trigger for kswapd itself as well. Also, the logic behind delaying anything when we haven't actually started writeback is not clear - it only delays actually starting that writeback. We'll still trigger the congestion waiting if (a) the process is kswapd, and we hit pages flagged for immediate reclaim (b) the process is not kswapd, and the zone backing dev writeback is actually congested. This probably needs to be revisited, but as it is this fixes a reported regression. Reported-by: Felipe Contreras <[email protected]> Pinpointed-by: Hillf Danton <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Mel Gorman <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f8409ab commit b738d76

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

mm/vmscan.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,20 +1573,18 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,
15731573
* If dirty pages are scanned that are not queued for IO, it
15741574
* implies that flushers are not keeping up. In this case, flag
15751575
* the zone ZONE_TAIL_LRU_DIRTY and kswapd will start writing
1576-
* pages from reclaim context. It will forcibly stall in the
1577-
* next check.
1576+
* pages from reclaim context.
15781577
*/
15791578
if (nr_unqueued_dirty == nr_taken)
15801579
zone_set_flag(zone, ZONE_TAIL_LRU_DIRTY);
15811580

15821581
/*
1583-
* In addition, if kswapd scans pages marked marked for
1584-
* immediate reclaim and under writeback (nr_immediate), it
1585-
* implies that pages are cycling through the LRU faster than
1582+
* If kswapd scans pages marked marked for immediate
1583+
* reclaim and under writeback (nr_immediate), it implies
1584+
* that pages are cycling through the LRU faster than
15861585
* they are written so also forcibly stall.
15871586
*/
1588-
if ((nr_unqueued_dirty == nr_taken || nr_immediate) &&
1589-
current_may_throttle())
1587+
if (nr_immediate && current_may_throttle())
15901588
congestion_wait(BLK_RW_ASYNC, HZ/10);
15911589
}
15921590

0 commit comments

Comments
 (0)