Skip to content

Commit

Permalink
writeback: initialize global_dirty_limit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fengguang Wu committed May 6, 2012
1 parent 4cd9069 commit 68809c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,7 @@ void writeback_set_ratelimit(void)
unsigned long background_thresh;
unsigned long dirty_thresh;
global_dirty_limits(&background_thresh, &dirty_thresh);
global_dirty_limit = dirty_thresh;
ratelimit_pages = dirty_thresh / (num_online_cpus() * 32);
if (ratelimit_pages < 16)
ratelimit_pages = 16;
Expand Down

0 comments on commit 68809c7

Please sign in to comment.