balance_domain_limits(mdtc, strictlimit);
}
- if (nr_dirty > gdtc->bg_thresh && !writeback_in_progress(wb))
+ if (!writeback_in_progress(wb) &&
+ (nr_dirty > gdtc->bg_thresh ||
+ (strictlimit && gdtc->wb_dirty > gdtc->wb_bg_thresh)))
wb_start_background_writeback(wb);
/*
* Unconditionally start background writeback if it's not
* already in progress. We need to do this because the global
* dirty threshold check above (nr_dirty > gdtc->bg_thresh)
- * doesn't account for these cases:
- *
- * a) strictlimit BDIs: throttling is calculated using per-wb
- * thresholds. The per-wb threshold can be exceeded even when
- * nr_dirty < gdtc->bg_thresh
- *
- * b) memcg-based throttling: memcg uses its own dirty count and
- * thresholds and can trigger throttling even when global
- * nr_dirty < gdtc->bg_thresh
+ * doesn't account for the memcg-based throttling case. memcg
+ * uses its own dirty count and thresholds and can trigger
+ * throttling even when global nr_dirty < gdtc->bg_thresh
*
* Writeback needs to be started else the writer stalls in the
* throttle loop waiting for dirty pages to be written back