]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/rdma: check ulimit 13655/head
authorSarit Zubakov <saritz@mellanox.com>
Mon, 20 Feb 2017 20:52:55 +0000 (20:52 +0000)
committerAdir Lev <adirl@mellanox.com>
Thu, 2 Mar 2017 06:59:35 +0000 (08:59 +0200)
On RDMA, memlock should be unlimited. If it is not then
warn the user

issue: 973654

Change-Id: If1e07722aaca9df88714828ca3f7398a2504e262
Signed-off-by: Sarit Zubakov <saritz@mellanox.com>
Signed-off-by: Adir Lev <adirl@mellanox.com>
src/msg/async/rdma/RDMAStack.cc

index 694c1364b5ba182a2dd035012cad2676bd827f32..90c0c43f360b2ca5bb200385e254fabe83b80581 100644 (file)
@@ -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 <poll.h>
+#include <sys/time.h>
+#include <sys/resource.h>
 
 #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);