mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
mm: vmscan: do not scale writeback pages when deciding whether to set ZONE_WRITEBACK
After the patch "mm: vmscan: Flatten kswapd priority loop" was merged the scanning priority of kswapd changed. The priority now rises until it is scanning enough pages to meet the high watermark. shrink_inactive_list sets ZONE_WRITEBACK if a number of pages were encountered under writeback but this value is scaled based on the priority. As kswapd frequently scans with a higher priority now it is relatively easy to set ZONE_WRITEBACK. This patch removes the scaling and treates writeback pages similar to how it treats unqueued dirty pages and congested pages. The user-visible effect should be that kswapd will writeback fewer pages from reclaim context. Signed-off-by: Mel Gorman <mgorman@suse.de> Cc: Rik van Riel <riel@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.cz> Cc: Dave Chinner <david@fromorbit.com> Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: 918fc718c5922520c499ad60f61b8df86b998ae9 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Change-Id: I5f75351d845ab0de4ca1c22ffba10e06ea45d111 [vinmenon@codeaurora.org: resolve trivial merge conflicts] Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
This commit is contained in:
parent
a0901266c3
commit
83ea991a3e
1 changed files with 1 additions and 15 deletions
16
mm/vmscan.c
16
mm/vmscan.c
|
@ -1533,25 +1533,11 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,
|
|||
* as there is no guarantee the dirtying process is throttled in the
|
||||
* same way balance_dirty_pages() manages.
|
||||
*
|
||||
* This scales the number of dirty pages that must be under writeback
|
||||
* before a zone gets flagged ZONE_WRITEBACK. It is a simple backoff
|
||||
* function that has the most effect in the range DEF_PRIORITY to
|
||||
* DEF_PRIORITY-2 which is the priority reclaim is considered to be
|
||||
* in trouble and reclaim is considered to be in trouble.
|
||||
*
|
||||
* DEF_PRIORITY 100% isolated pages must be PageWriteback to throttle
|
||||
* DEF_PRIORITY-1 50% must be PageWriteback
|
||||
* DEF_PRIORITY-2 25% must be PageWriteback, kswapd in trouble
|
||||
* ...
|
||||
* DEF_PRIORITY-6 For SWAP_CLUSTER_MAX isolated pages, throttle if any
|
||||
* isolated page is PageWriteback
|
||||
*
|
||||
* Once a zone is flagged ZONE_WRITEBACK, kswapd will count the number
|
||||
* of pages under pages flagged for immediate reclaim and stall if any
|
||||
* are encountered in the nr_immediate check below.
|
||||
*/
|
||||
if (nr_writeback && nr_writeback >=
|
||||
(nr_taken >> (DEF_PRIORITY - sc->priority)))
|
||||
if (nr_writeback && nr_writeback == nr_taken)
|
||||
zone_set_flag(zone, ZONE_WRITEBACK);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue