From: Sarit Zubakov Date: Mon, 20 Feb 2017 20:52:55 +0000 (+0000) Subject: msg/async/rdma: check ulimit X-Git-Tag: v12.0.1~207^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=750bd5e7df4d4e00c3351d95d3f47cbafe682354;p=ceph.git msg/async/rdma: check ulimit On RDMA, memlock should be unlimited. If it is not then warn the user issue: 973654 Change-Id: If1e07722aaca9df88714828ca3f7398a2504e262 Signed-off-by: Sarit Zubakov Signed-off-by: Adir Lev --- diff --git a/src/msg/async/rdma/RDMAStack.cc b/src/msg/async/rdma/RDMAStack.cc index 694c1364b5ba1..90c0c43f360b2 100644 --- a/src/msg/async/rdma/RDMAStack.cc +++ b/src/msg/async/rdma/RDMAStack.cc @@ -1,4 +1,4 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system @@ -15,6 +15,8 @@ */ #include +#include +#include #include "include/str_list.h" #include "common/deleter.h" @@ -545,6 +547,14 @@ void RDMAWorker::handle_tx_event() RDMAStack::RDMAStack(CephContext *cct, const string &t): NetworkStack(cct, t) { + //Check ulimit + struct rlimit limit; + getrlimit(RLIMIT_MEMLOCK, &limit); + if (limit.rlim_cur != RLIM_INFINITY || limit.rlim_max != RLIM_INFINITY) { + lderr(cct) << __func__ << "!!! WARNING !!! For RDMA to work properly user memlock (ulimit -l) must be big enough to allow large amount of registered memory." + " We recommend setting this parameter to infinity" << dendl; + } + if (!global_infiniband) global_infiniband = new Infiniband( cct, cct->_conf->ms_async_rdma_device_name, cct->_conf->ms_async_rdma_port_num);