writeback: initialize global_dirty_limit
authorFengguang Wu <fengguang.wu@intel.com>
Sun, 6 May 2012 05:21:42 +0000 (13:21 +0800)
committerFengguang Wu <fengguang.wu@intel.com>
Sun, 6 May 2012 05:41:58 +0000 (13:41 +0800)
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>
mm/page-writeback.c

index 9dec97fee3750d1772df78948d37377a95ff231c..93d8d2f7108ccb8b3c5a73de42361f23d98049c1 100644 (file)
@@ -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;
This page took 0.031473 seconds and 5 git commands to generate.