From: Jamie Liu Date: Wed, 10 Dec 2014 23:43:20 +0000 (-0800) Subject: mm: vmscan: count only dirty pages as congested X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1da58ee2a0279a1b0afd3248396de5659b8cf95b;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git mm: vmscan: count only dirty pages as congested shrink_page_list() counts all pages with a mapping, including clean pages, toward nr_congested if they're on a write-congested BDI. shrink_inactive_list() then sets ZONE_CONGESTED if nr_dirty == nr_congested. Fix this apples-to-oranges comparison by only counting pages for nr_congested if they count for nr_dirty. Signed-off-by: Jamie Liu Cc: Johannes Weiner Cc: Mel Gorman Cc: Greg Thelen Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/vmscan.c b/mm/vmscan.c index 59605b7c9970..53157e157061 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -874,7 +874,8 @@ static unsigned long shrink_page_list(struct list_head *page_list, * end of the LRU a second time. */ mapping = page_mapping(page); - if ((mapping && bdi_write_congested(mapping->backing_dev_info)) || + if (((dirty || writeback) && mapping && + bdi_write_congested(mapping->backing_dev_info)) || (writeback && PageReclaim(page))) nr_congested++;