aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/fs-writeback.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 28076562ada0..6401cd76f109 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -658,14 +658,21 @@ long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages)
658 return nr_pages - work.nr_pages; 658 return nr_pages - work.nr_pages;
659} 659}
660 660
661static inline bool over_bground_thresh(void) 661static bool over_bground_thresh(struct backing_dev_info *bdi)
662{ 662{
663 unsigned long background_thresh, dirty_thresh; 663 unsigned long background_thresh, dirty_thresh;
664 664
665 global_dirty_limits(&background_thresh, &dirty_thresh); 665 global_dirty_limits(&background_thresh, &dirty_thresh);
666 666
667 return (global_page_state(NR_FILE_DIRTY) + 667 if (global_page_state(NR_FILE_DIRTY) +
668 global_page_state(NR_UNSTABLE_NFS) > background_thresh); 668 global_page_state(NR_UNSTABLE_NFS) > background_thresh)
669 return true;
670
671 if (bdi_stat(bdi, BDI_RECLAIMABLE) >
672 bdi_dirty_limit(bdi, background_thresh))
673 return true;
674
675 return false;
669} 676}
670 677
671/* 678/*
@@ -727,7 +734,7 @@ static long wb_writeback(struct bdi_writeback *wb,
727 * For background writeout, stop when we are below the 734 * For background writeout, stop when we are below the
728 * background dirty threshold 735 * background dirty threshold
729 */ 736 */
730 if (work->for_background && !over_bground_thresh()) 737 if (work->for_background && !over_bground_thresh(wb->bdi))
731 break; 738 break;
732 739
733 if (work->for_kupdate) { 740 if (work->for_kupdate) {
@@ -811,7 +818,7 @@ static unsigned long get_nr_dirty_pages(void)
811 818
812static long wb_check_background_flush(struct bdi_writeback *wb) 819static long wb_check_background_flush(struct bdi_writeback *wb)
813{ 820{
814 if (over_bground_thresh()) { 821 if (over_bground_thresh(wb->bdi)) {
815 822
816 struct wb_writeback_work work = { 823 struct wb_writeback_work work = {
817 .nr_pages = LONG_MAX, 824 .nr_pages = LONG_MAX,