Whamcloud - gitweb
LU-11897 ost: improve memory allocation for ost 27/34127/7
authorAndrew Perepechko <c17827@cray.com>
Fri, 26 Oct 2018 08:29:03 +0000 (11:29 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 18 Feb 2019 06:37:41 +0000 (06:37 +0000)
OST_BUFSIZE is defined as 17 KiB. Lustre uses
OBD_CPT_ALLOC_LARGE() to allocate buffers, which,
in turn, uses kmalloc_node(). kmalloc_node(8192+) falls
back to the traditional buddy allocator kmalloc_large_node().

In the end, 32 KiB is allocated using a 17 KiB allocation
request.

This patch changes OST_BUFSIZE to 32 KiB so we can
effectively use the whole allocated buffer.

Change-Id: I93ce5b26eff4a6a1a17b2a9bfb83161528570197
Signed-off-by: Andrew Perepechko <c17827@cray.com>
Reviewed-by: Alexey Lyashkov <c17817@cray.com>
Reviewed-by: Alexander Zarochentsev <c17826@cray.com>
Tested-by: Alexander Lezhoev <c17454@cray.com>
Cray-bug-id: LUS-6657
Reviewed-on: https://review.whamcloud.com/34127
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/lustre_net.h
lustre/ptlrpc/service.c

index 7ad28ce..3e1e299 100644 (file)
 
 #define OST_NBUFS              64
 /** OST_BUFSIZE = max_reqsize + max sptlrpc payload size */
 
 #define OST_NBUFS              64
 /** OST_BUFSIZE = max_reqsize + max sptlrpc payload size */
-#define OST_BUFSIZE            max_t(int, OST_MAXREQSIZE + 1024, 16 * 1024)
+#define OST_BUFSIZE            max_t(int, OST_MAXREQSIZE + 1024, 32 * 1024)
 /**
  * OST_IO_MAXREQSIZE is 18K, giving extra 46K can increase buffer utilization
  * rate of request buffer, please check comment of MDS_LOV_BUFSIZE for details.
 /**
  * OST_IO_MAXREQSIZE is 18K, giving extra 46K can increase buffer utilization
  * rate of request buffer, please check comment of MDS_LOV_BUFSIZE for details.
index 7092e7d..66efefd 100644 (file)
@@ -781,6 +781,12 @@ ptlrpc_register_service(struct ptlrpc_service_conf *conf,
        service->srv_rep_portal         = conf->psc_buf.bc_rep_portal;
        service->srv_req_portal         = conf->psc_buf.bc_req_portal;
 
        service->srv_rep_portal         = conf->psc_buf.bc_rep_portal;
        service->srv_req_portal         = conf->psc_buf.bc_req_portal;
 
+       /* With slab/alloc_pages buffer size will be rounded up to 2^n */
+       if (service->srv_buf_size & (service->srv_buf_size - 1)) {
+               int round = size_roundup_power2(service->srv_buf_size);
+               service->srv_buf_size = round;
+       }
+
        /* Increase max reply size to next power of two */
        service->srv_max_reply_size = 1;
        while (service->srv_max_reply_size <
        /* Increase max reply size to next power of two */
        service->srv_max_reply_size = 1;
        while (service->srv_max_reply_size <