Whamcloud - gitweb
Reduce per-OSC client side cache to avoid pathalogical cache-flush times
authoradilger <adilger>
Tue, 30 Dec 2003 20:56:18 +0000 (20:56 +0000)
committeradilger <adilger>
Tue, 30 Dec 2003 20:56:18 +0000 (20:56 +0000)
with lots of clients.  Tested at LLNL for a long time already.
Reduce max per-OSC RPCs in flight to reduce OST file fragmentation with
out-of-order writes to the filesystem.
r=Zach

lustre/include/linux/obd.h
lustre/ldlm/ldlm_lib.c
lustre/osc/lproc_osc.c

index b3f5d8c..0062617 100644 (file)
@@ -173,6 +173,11 @@ struct filter_obd {
 
 struct mds_server_data;
 
+#define OSC_MAX_RIF_DEFAULT       4
+#define OSC_MAX_RIF_MAX          32
+#define OSC_MAX_DIRTY_DEFAULT     4
+#define OSC_MAX_DIRTY_MB_MAX    256     /* totally arbitrary */
+
 struct mdc_rpc_lock;
 struct client_obd {
         struct obd_import       *cl_import;
index 4961e32..30d3ac5 100644 (file)
@@ -99,7 +99,7 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf)
         init_MUTEX(&cli->cl_dirty_sem);
         cli->cl_dirty = 0;
         cli->cl_dirty_granted = 0;
-        cli->cl_dirty_max = 64*1024*1024; /* some default */
+        cli->cl_dirty_max = OSC_MAX_DIRTY_DEFAULT * 1024 * 1024;
         cli->cl_ost_can_grant = 1;
         INIT_LIST_HEAD(&cli->cl_cache_waiters);
         INIT_LIST_HEAD(&cli->cl_loi_ready_list);
@@ -110,7 +110,7 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf)
         spin_lock_init(&cli->cl_read_page_hist.oh_lock);
         spin_lock_init(&cli->cl_write_page_hist.oh_lock);
         cli->cl_max_pages_per_rpc = PTL_MD_MAX_PAGES;
-        cli->cl_max_rpcs_in_flight = 8;
+        cli->cl_max_rpcs_in_flight = OSC_MAX_RIF_DEFAULT;
 
         ldlm_get_ref();
         if (rc) {
index 5d790d5..695f410 100644 (file)
@@ -35,9 +35,6 @@ static struct lprocfs_vars lprocfs_obd_vars[]  = { {0} };
 static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
 #else
 
-#define OSC_MAX_RIF_MAX 32
-#define OSC_MAX_DIRTY_MB_MAX 4096 /* totally arbitrary */
-
 int osc_rd_max_pages_per_rpc(char *page, char **start, off_t off, int count,
                              int *eof, void *data)
 {
@@ -80,7 +77,7 @@ int osc_rd_max_rpcs_in_flight(char *page, char **start, off_t off, int count,
         int rc;
 
         spin_lock(&cli->cl_loi_list_lock);
-        rc = snprintf(page, count, "%d\n", cli->cl_max_rpcs_in_flight);
+        rc = snprintf(page, count, "%u\n", cli->cl_max_rpcs_in_flight);
         spin_unlock(&cli->cl_loi_list_lock);
         return rc;
 }
@@ -289,9 +286,9 @@ static struct lprocfs_vars lprocfs_obd_vars[] = {
         //{ "filegroups",      lprocfs_rd_filegroups,  0, 0 },
         { "ost_server_uuid", lprocfs_rd_server_uuid, 0, 0 },
         { "ost_conn_uuid",   lprocfs_rd_conn_uuid, 0, 0 },
-        { "max_pages_per_rpc", osc_rd_max_pages_per_rpc, 
+        { "max_pages_per_rpc", osc_rd_max_pages_per_rpc,
                                osc_wr_max_pages_per_rpc, 0 },
-        { "max_rpcs_in_flight", osc_rd_max_rpcs_in_flight, 
+        { "max_rpcs_in_flight", osc_rd_max_rpcs_in_flight,
                                 osc_wr_max_rpcs_in_flight, 0 },
         { "max_dirty_mb", osc_rd_max_dirty_mb, osc_wr_max_dirty_mb, 0 },
         { "cur_dirty_bytes", osc_rd_cur_dirty_bytes, 0, 0 },