Commit 68809c7108b9a75baf2a888b1c19ce1a4680f600

Authored by Fengguang Wu
1 parent 4cd9069a0a

writeback: initialize global_dirty_limit

This prevents global_dirty_limit from remaining 0 (the initial value)
for long time, since it's only updated in update_dirty_limit() when
above the dirty freerun area.

It will avoid unexpected consequences when some random code use it as a
convenient approximation of the global dirty threshold.

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

... ... @@ -1568,6 +1568,7 @@
1568 1568 unsigned long background_thresh;
1569 1569 unsigned long dirty_thresh;
1570 1570 global_dirty_limits(&background_thresh, &dirty_thresh);
  1571 + global_dirty_limit = dirty_thresh;
1571 1572 ratelimit_pages = dirty_thresh / (num_online_cpus() * 32);
1572 1573 if (ratelimit_pages < 16)
1573 1574 ratelimit_pages = 16;