Whamcloud - gitweb
LU-2925 out: increase reqbuf size for OUT
authorLiang Zhen <liang.zhen@intel.com>
Fri, 8 Mar 2013 05:20:44 +0000 (13:20 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 15 Mar 2013 05:22:59 +0000 (01:22 -0400)
OUT service for DNE can have request size up to 9K, however, it's
using default definition of MDS request buffer size which is 5K.
This patch added individual definitions for OUT reqsize and
req_bufsize.
This patch also made some changes to MDS_BUFSIZE and MDS_LOV_BUFSIZE
to unify style of macros.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Change-Id: I102d6b2aed1e0ed495f055fa3de0c7de7de8c28d
Reviewed-on: http://review.whamcloud.com/5653
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Reviewed-by: wangdi <di.wang@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/include/lustre_net.h
lustre/mdt/mdt_mds.c

index f4a2e05..a606ff2 100644 (file)
  */
 #define MDS_LOV_MAXREPSIZE     MDS_LOV_MAXREQSIZE
 
+/**
+ * The update request includes all of updates from the create, which might
+ * include linkea (4K maxim), together with other updates, we set it to 9K:
+ * lustre_msg + ptlrpc_body + UPDATE_BUF_SIZE (8K)
+ */
+#define MDS_OUT_MAXREQSIZE     (9 * 1024)
+#define MDS_OUT_MAXREPSIZE     MDS_MAXREPSIZE
+
 /** MDS_BUFSIZE = max_reqsize (w/o LOV EA) + max sptlrpc payload size */
-#define MDS_BUFSIZE            (MDS_MAXREQSIZE + 1024)
+#define MDS_BUFSIZE            max_t(int, MDS_MAXREQSIZE + 1024, 8 * 1024)
+
 /**
  * MDS_LOV_BUFSIZE should be at least max_reqsize (with LOV EA) +
  * max sptlrpc payload size, however, we need to allocate a much larger buffer
  * In the meanwhile, size of rqbd can't be too large, because rqbd can't be
  * reused until all requests fit in it have been processed and released,
  * which means one long blocked request can prevent the rqbd be reused.
- * Now we give extra 128K to buffer size, so even each rqbd is unlinked
- * from LNet with unused 48K, buffer utilization will be about 72%.
+ * Now we set request buffer size to 128K, so even each rqbd is unlinked
+ * from LNet with unused 48K, buffer utilization will be about 62%.
  * Please check LU-2432 for details.
  */
 /** MDS_LOV_BUFSIZE = max_reqsize (w/ LOV EA) + max sptlrpc payload size */
-#define MDS_LOV_BUFSIZE                (MDS_LOV_MAXREQSIZE + (1 << 17))
+#define MDS_LOV_BUFSIZE                max_t(int, MDS_LOV_MAXREQSIZE + 1024, \
+                                          128 * 1024)
+
+/**
+ * MDS_OUT_BUFSIZE = max_out_reqsize + max sptlrpc payload (~1K) which is
+ * about 10K, for the same reason as MDS_LOV_BUFSIZE, we also give some
+ * extra bytes to each request buffer to improve buffer utilization rate.
+  */
+#define MDS_OUT_BUFSIZE                max_t(int, MDS_OUT_MAXREQSIZE + 1024, \
+                                          24 * 1024)
 
 /** FLD_MAXREQSIZE == lustre_msg + __u32 padding + ptlrpc_body + opc */
 #define FLD_MAXREQSIZE  (160)
index 6d5865e..cbdf73a 100644 (file)
@@ -563,9 +563,9 @@ static int mds_start_ptlrpc_service(struct mds_device *m)
                .psc_watchdog_factor    = MDT_SERVICE_WATCHDOG_FACTOR,
                .psc_buf                = {
                        .bc_nbufs               = MDS_NBUFS,
-                       .bc_buf_size            = MDS_BUFSIZE,
-                       .bc_req_max_size        = MDS_MAXREQSIZE,
-                       .bc_rep_max_size        = MDS_MAXREPSIZE,
+                       .bc_buf_size            = MDS_OUT_BUFSIZE,
+                       .bc_req_max_size        = MDS_OUT_MAXREQSIZE,
+                       .bc_rep_max_size        = MDS_OUT_MAXREPSIZE,
                        .bc_req_portal          = MDS_MDS_PORTAL,
                        .bc_rep_portal          = MDC_REPLY_PORTAL,
                },