Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vsock: Have two separate threads for handling TX and RX #323

Open
techiepriyansh opened this issue Apr 14, 2023 · 4 comments
Open

vsock: Have two separate threads for handling TX and RX #323

techiepriyansh opened this issue Apr 14, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@techiepriyansh
Copy link
Contributor

Currently, the VhostUserVsockBackend handles both TX and RX in a single thread. It would be nice to have two separate threads handling TX and RX.

Implementing this would involve the following:

  • Define two threads in VhostUserVsockBackend with the appropriate queue_masks: 1 for the RX thread and 2 for the TX thread.
  • Set the TX thread's vring worker to also listen for BACKEND_EVENTs by calling set_vring_worker during initialization in start_backend_server.
  • Handle RX or TX in VhostUserVsockBackend::handle_event depending on the thread_id.
  • Refactor the hashmaps and backend_rxq contained in VsockThreadBackend to be accessible by both the threads (maybe over an RwLock).
  • Make the option to choose between single-threaded or multi-threaded configurable by the user.
@stefano-garzarella
Copy link
Member

Thank you for the analysis! If you have time and interest to start this work, go ahead, otherwise we'll do it later because it would be a great cleanup.

@techiepriyansh
Copy link
Contributor Author

Yes, I'll get to it in a few days.

@ramyak-mehra
Copy link
Contributor

Hey i see this hasn't been picked up in quite some time. If no one is picking this up shall i do it?

@stefano-garzarella
Copy link
Member

@ramyak-mehra great! yes please, go head.

IIUC @techiepriyansh is busy, but feel free to ping us if the situation is changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants