Whamcloud - gitweb
LU-4933 osc: Automatically tune the max_dirty_mb
[fs/lustre-release.git] / lustre / ldlm / ldlm_lib.c
index a3769d5..94e4020 100644 (file)
@@ -349,9 +349,9 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
         cli->cl_dirty = 0;
         cli->cl_avail_grant = 0;
        /* FIXME: Should limit this for the sum of all cl_dirty_max. */
-       cli->cl_dirty_max = OSC_MAX_DIRTY_DEFAULT * 1024 * 1024;
-       if (cli->cl_dirty_max >> PAGE_CACHE_SHIFT > totalram_pages / 8)
-               cli->cl_dirty_max = totalram_pages << (PAGE_CACHE_SHIFT - 3);
+       /* cl_dirty_max may be changed at connect time in
+        * ptlrpc_connect_interpret(). */
+       client_adjust_max_dirty(cli);
        CFS_INIT_LIST_HEAD(&cli->cl_cache_waiters);
        CFS_INIT_LIST_HEAD(&cli->cl_loi_ready_list);
        CFS_INIT_LIST_HEAD(&cli->cl_loi_hp_ready_list);