From: Vladimir Davydov Date: Tue, 8 Sep 2015 22:02:18 +0000 (-0700) Subject: mm: vmscan: never isolate more pages than necessary X-Git-Tag: omap-for-v4.3/fixes-rc1~54^2~59 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b802f101d0c6caeeee89066dc2c8665082a83df;p=pandora-kernel.git mm: vmscan: never isolate more pages than necessary If transparent huge pages are enabled, we can isolate many more pages than we actually need to scan, because we count both single and huge pages equally in isolate_lru_pages(). Since commit 5bc7b8aca942d ("mm: thp: add split tail pages to shrink page list in page reclaim"), we scan all the tail pages immediately after a huge page split (see shrink_page_list()). As a result, we can reclaim up to SWAP_CLUSTER_MAX * HPAGE_PMD_NR (512 MB) in one run! This is easy to catch on memcg reclaim with zswap enabled. The latter makes swapout instant so that if we happen to scan an unreferenced huge page we will evict both its head and tail pages immediately, which is likely to result in excessive reclaim. Signed-off-by: Vladimir Davydov Cc: Johannes Weiner Reviewed-by: Michal Hocko Cc: Vlastimil Babka Cc: Minchan Kim Cc: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed