Skip to content

Conversation

@Binyang2014
Copy link
Contributor

Fix #533

@liangyuRain
Copy link

Also, I wonder if the MR registered in IB should also be properly unregistered in RegisteredMemory's destructor?

const IbMr* mr = contextImpl.getIbContext(ibTransport)->registerMr(data, size);

@Binyang2014
Copy link
Contributor Author

Also, I wonder if the MR registered in IB should also be properly unregistered in RegisteredMemory's destructor?

const IbMr* mr = contextImpl.getIbContext(ibTransport)->registerMr(data, size);

For MR and QP, thinking if we could wrap it into shared_ptr.

WARN("Attempted to remove a memory that is not registered or already removed: %u", memoryId);
return;
}
memories_[memoryId] = RegisteredMemory();
Copy link
Contributor

@chhwang chhwang Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a resource lock so that the removal doesn't happen while there exists unflushed triggers on the flight in the proxy. Also, we need a mechanism that prevents proxies on remote ranks from processing requests on this RegisteredMemory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think users are responsible for safely releasing the buffer. Before removing it, ensure that no peers or device-side operations are still accessing this memory. Adding spinlock here to prevent race conditions inside the proxy_channel.

@Binyang2014 Binyang2014 marked this pull request as ready for review June 13, 2025 02:36
@Binyang2014
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Binyang2014
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Binyang2014 Binyang2014 marked this pull request as draft August 1, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] RegisteredMemory not properly destroyed

4 participants