Whamcloud - gitweb
Add ability to start more than one create thread per OSS.
authordeen <deen>
Wed, 22 Aug 2007 23:00:06 +0000 (23:00 +0000)
committerdeen <deen>
Wed, 22 Aug 2007 23:00:06 +0000 (23:00 +0000)
b=12446
i=adilger
i=nathan

lustre/ChangeLog
lustre/ost/ost_handler.c
lustre/ost/ost_internal.h

index cd254c5..f745d47 100644 (file)
@@ -134,6 +134,11 @@ Details    : The journal checksum feature adds two new flags i.e
             blocks to be written to disk. This behavior is controlled
             using JBD2_FEATURE_ASYNC_COMMIT flag.
 
             blocks to be written to disk. This behavior is controlled
             using JBD2_FEATURE_ASYNC_COMMIT flag.
 
+Severity   : minor
+Bugzilla   : 12446
+Description: OSS needs mutliple precreate threads
+Details    : Add ability to start more than one create thread per OSS.
+
 --------------------------------------------------------------------------------
 
 2007-08-10         Cluster File Systems, Inc. <info@clusterfs.com>
 --------------------------------------------------------------------------------
 
 2007-08-10         Cluster File Systems, Inc. <info@clusterfs.com>
index 966728b..e72d6d1 100644 (file)
@@ -59,6 +59,10 @@ static int ost_num_threads;
 CFS_MODULE_PARM(ost_num_threads, "i", int, 0444,
                 "number of OST service threads to start (deprecated)");
 
 CFS_MODULE_PARM(ost_num_threads, "i", int, 0444,
                 "number of OST service threads to start (deprecated)");
 
+static int oss_num_create_threads;
+CFS_MODULE_PARM(oss_num_create_threads, "i", int, 0444,
+                "number of OSS create threads to start");
+
 void oti_to_request(struct obd_trans_info *oti, struct ptlrpc_request *req)
 {
         struct oti_req_ack_lock *ack_lock;
 void oti_to_request(struct obd_trans_info *oti, struct ptlrpc_request *req)
 {
         struct oti_req_ack_lock *ack_lock;
@@ -1712,6 +1716,8 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
         struct lprocfs_static_vars lvars;
         int oss_min_threads;
         int oss_max_threads;
         struct lprocfs_static_vars lvars;
         int oss_min_threads;
         int oss_max_threads;
+        int oss_min_create_threads;
+        int oss_max_create_threads;
         int rc;
         ENTRY;
 
         int rc;
         ENTRY;
 
@@ -1765,12 +1771,26 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
         if (rc)
                 GOTO(out_service, rc = -EINVAL);
 
         if (rc)
                 GOTO(out_service, rc = -EINVAL);
 
+        if (oss_num_create_threads) {
+                if (oss_num_create_threads > OSS_MAX_CREATE_THREADS)
+                        oss_num_create_threads = OSS_MAX_CREATE_THREADS;
+                if (oss_num_create_threads < OSS_DEF_CREATE_THREADS)
+                        oss_num_create_threads = OSS_DEF_CREATE_THREADS;
+                oss_min_create_threads = oss_max_create_threads =
+                        oss_num_create_threads;
+        } else {
+                oss_min_create_threads = OSS_DEF_CREATE_THREADS;
+                oss_max_create_threads = OSS_MAX_CREATE_THREADS;
+        }
+
         ost->ost_create_service =
                 ptlrpc_init_svc(OST_NBUFS, OST_BUFSIZE, OST_MAXREQSIZE,
                                 OST_MAXREPSIZE, OST_CREATE_PORTAL,
                                 OSC_REPLY_PORTAL,
                                 OST_WATCHDOG_TIMEOUT, ost_handle, "ost_create",
         ost->ost_create_service =
                 ptlrpc_init_svc(OST_NBUFS, OST_BUFSIZE, OST_MAXREQSIZE,
                                 OST_MAXREPSIZE, OST_CREATE_PORTAL,
                                 OSC_REPLY_PORTAL,
                                 OST_WATCHDOG_TIMEOUT, ost_handle, "ost_create",
-                                obd->obd_proc_entry, ost_print_req, 1, 1,
+                                obd->obd_proc_entry, ost_print_req,
+                                oss_min_create_threads,
+                                oss_max_create_threads,
                                 "ll_ost_creat", LCT_DT_THREAD);
         if (ost->ost_create_service == NULL) {
                 CERROR("failed to start OST create service\n");
                                 "ll_ost_creat", LCT_DT_THREAD);
         if (ost->ost_create_service == NULL) {
                 CERROR("failed to start OST create service\n");
index ecc977a..82a40b9 100644 (file)
@@ -37,6 +37,9 @@ struct ost_thread_local_cache {
 
 struct ost_thread_local_cache *ost_tls(struct ptlrpc_request *r);
 
 
 struct ost_thread_local_cache *ost_tls(struct ptlrpc_request *r);
 
+#define OSS_DEF_CREATE_THREADS  1UL
+#define OSS_MAX_CREATE_THREADS 16UL
+
 /* Quota stuff */
 extern quota_interface_t *quota_interface;
 
 /* Quota stuff */
 extern quota_interface_t *quota_interface;