summaryrefslogtreecommitdiff
path: root/mm/page-writeback.c
diff options
context:
space:
mode:
authorVinayak Menon <vinmenon@codeaurora.org>2015-03-26 11:58:45 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:03:54 -0700
commit3086328d5ff69cee18399a68dd9fd9c5f10a4c2d (patch)
tree8f865af55b3d8221a897248b0329cc46a2f7fda0 /mm/page-writeback.c
parentd487a9f1f7291870ebeac3bc243f9fe65dcdfefb (diff)
mm: page-writeback: fix page state calculation in throttle_vm_writeout
It was found that a number of tasks were blocked in the reclaim path (throttle_vm_writeout) for seconds, because of vmstat_diff not being synced in time. Fix that by adding a new function global_page_state_snapshot. Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org> Change-Id: Iec167635ad724a55c27bdbd49eb8686e7857216c
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r--mm/page-writeback.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index d15d88c8efa1..112c0bebfff3 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -1938,6 +1938,12 @@ void throttle_vm_writeout(gfp_t gfp_mask)
if (global_page_state(NR_UNSTABLE_NFS) +
global_page_state(NR_WRITEBACK) <= dirty_thresh)
break;
+ /* Try safe version */
+ else if (unlikely(global_page_state_snapshot(NR_UNSTABLE_NFS) +
+ global_page_state_snapshot(NR_WRITEBACK) <=
+ dirty_thresh))
+ break;
+
congestion_wait(BLK_RW_ASYNC, HZ/10);
/*