aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page-writeback.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r--mm/page-writeback.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 5240e426c1f7..945559fb63d2 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -46,7 +46,7 @@
46static long ratelimit_pages = 32; 46static long ratelimit_pages = 32;
47 47
48static long total_pages; /* The total number of pages in the machine. */ 48static long total_pages; /* The total number of pages in the machine. */
49static int dirty_exceeded; /* Dirty mem may be over limit */ 49static int dirty_exceeded __cacheline_aligned_in_smp; /* Dirty mem may be over limit */
50 50
51/* 51/*
52 * When balance_dirty_pages decides that the caller needs to perform some 52 * When balance_dirty_pages decides that the caller needs to perform some
@@ -212,7 +212,8 @@ static void balance_dirty_pages(struct address_space *mapping)
212 if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh) 212 if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh)
213 break; 213 break;
214 214
215 dirty_exceeded = 1; 215 if (!dirty_exceeded)
216 dirty_exceeded = 1;
216 217
217 /* Note: nr_reclaimable denotes nr_dirty + nr_unstable. 218 /* Note: nr_reclaimable denotes nr_dirty + nr_unstable.
218 * Unstable writes are a feature of certain networked 219 * Unstable writes are a feature of certain networked
@@ -234,7 +235,7 @@ static void balance_dirty_pages(struct address_space *mapping)
234 blk_congestion_wait(WRITE, HZ/10); 235 blk_congestion_wait(WRITE, HZ/10);
235 } 236 }
236 237
237 if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh) 238 if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh && dirty_exceeded)
238 dirty_exceeded = 0; 239 dirty_exceeded = 0;
239 240
240 if (writeback_in_progress(bdi)) 241 if (writeback_in_progress(bdi))