mirror of
https://github.com/ceph/ceph
synced 2025-02-21 01:47:25 +00:00
msg/async/rdma: add atomic and lock protection
Signed-off-by: Haomai Wang <haomai@xsky.com>
This commit is contained in:
parent
6b773887a3
commit
584f64e5e4
@ -778,7 +778,7 @@ int Infiniband::MemoryManager::get_send_buffers(std::vector<Chunk*> &c, size_t b
|
||||
return send->get_buffers(c, bytes);
|
||||
}
|
||||
|
||||
bool Infiniband::init_prereq = false;
|
||||
static std::atomic<bool> init_prereq = {false};
|
||||
|
||||
void Infiniband::verify_prereq(CephContext *cct) {
|
||||
|
||||
@ -792,7 +792,7 @@ void Infiniband::verify_prereq(CephContext *cct) {
|
||||
ldout(cct, 20) << __func__ << " ms_async_rdma_enable_hugepage value is: " << cct->_conf->ms_async_rdma_enable_hugepage << dendl;
|
||||
if (cct->_conf->ms_async_rdma_enable_hugepage){
|
||||
rc = setenv("RDMAV_HUGEPAGES_SAFE","1",1);
|
||||
ldout(cct, 20) << __func__ << " RDMAV_HUGEPAGES_SAFE is set as: " << getenv("RDMAV_HUGEPAGES_SAFE") << dendl;
|
||||
ldout(cct, 0) << __func__ << " RDMAV_HUGEPAGES_SAFE is set as: " << getenv("RDMAV_HUGEPAGES_SAFE") << dendl;
|
||||
if (rc) {
|
||||
lderr(cct) << __func__ << " failed to export RDMA_HUGEPAGES_SAFE. On RDMA must be exported before using huge pages. Application aborts." << dendl;
|
||||
ceph_abort();
|
||||
|
@ -328,7 +328,6 @@ class Infiniband {
|
||||
bool initialized = false;
|
||||
const std::string &device_name;
|
||||
uint8_t port_num;
|
||||
static bool init_prereq;
|
||||
|
||||
public:
|
||||
explicit Infiniband(CephContext *c);
|
||||
|
@ -95,6 +95,7 @@ void RDMADispatcher::polling_start()
|
||||
|
||||
void RDMADispatcher::polling_stop()
|
||||
{
|
||||
Mutex::Locker l(lock);
|
||||
done = true;
|
||||
if (!t.joinable())
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user