Skip to content

Revert readv optimization in virtio-net device #4840

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

Closed

Conversation

bchalios
Copy link
Contributor

@bchalios bchalios commented Oct 8, 2024

The changes introduced in IoVecBufferMut that allowed implementing readv support for virtio-net regressed the performance of vsock device. This is because now, when we create IoVecBufferMut objects we do a bunch (1 memfd_create and 3 mmap) of system calls. virtio-net device avoids the performance issue because it creates a single IoVecBufferMut and re-uses it, whereas vsock is creating a new IoVecBufferMut object for every packet it receives.

We have a fix for this, which essentially creates a single IoVecBufferMut that reuses for all the incoming vsock packets during a connection. The problem with the fix is that it makes unit-tests really unhappy and we need a significant amount of work to fix them.

So, revert the PR to have main in a clean state. We will fix the vsock issues out-of-band and re-open the PR.

This reverts commits:

from PR #4799

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this
    PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet
    contribution quality standards.

  • This functionality cannot be added in rust-vmm.

The changes introduced in IoVecBufferMut that allowed implementing readv
support for virtio-net regressed the performance of vsock device. This
is because now, when we create IoVecBufferMut objects we do a bunch (1
memfd_create and 3 mmap) of system calls. virtio-net device avoids the
performance issue because it creates a single IoVecBufferMut and re-uses
it, whereas vsock is creating a new IoVecBufferMut object for every
packet it receives.

We have a fix for this, which essentially creates a single
IoVecBufferMut that reuses for all the incoming vsock packets during a
connection. The problem with the fix is that it makes unit-tests really
unhappy and we need a significant amount of work to fix them.

So, revert the PR to have main in a clean state. We will fix the vsock
issues out-of-band and re-open the PR.

This reverts commits:
- bc0ba43
- 667aba4
- 5d718d4
- 14e6e33
- 1e4c632

from PR firecracker-microvm#4799

Signed-off-by: Babis Chalios <[email protected]>
@bchalios bchalios force-pushed the revert_virtio_net_readv branch from 5fe4322 to 3452d82 Compare October 8, 2024 09:57
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 96.55172% with 5 lines in your changes missing coverage. Please review.

Project coverage is 84.35%. Comparing base (6bfe235) to head (3452d82).

Files with missing lines Patch % Lines
src/vmm/src/devices/virtio/net/device.rs 95.86% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4840      +/-   ##
==========================================
- Coverage   84.42%   84.35%   -0.07%     
==========================================
  Files         250      249       -1     
  Lines       27749    27505     -244     
==========================================
- Hits        23427    23202     -225     
+ Misses       4322     4303      -19     
Flag Coverage Δ
5.10-c5n.metal 84.59% <96.55%> (-0.08%) ⬇️
5.10-m5n.metal 84.57% <96.55%> (-0.07%) ⬇️
5.10-m6a.metal 83.86% <96.55%> (-0.09%) ⬇️
5.10-m6g.metal 80.92% <96.55%> (-0.12%) ⬇️
5.10-m6i.metal 84.57% <96.55%> (-0.08%) ⬇️
5.10-m7g.metal 80.92% <96.55%> (-0.12%) ⬇️
6.1-c5n.metal 84.59% <96.55%> (-0.08%) ⬇️
6.1-m5n.metal 84.57% <96.55%> (-0.08%) ⬇️
6.1-m6a.metal 83.86% <96.55%> (-0.10%) ⬇️
6.1-m6g.metal 80.91% <96.55%> (-0.13%) ⬇️
6.1-m6i.metal 84.56% <96.55%> (-0.08%) ⬇️
6.1-m7g.metal 80.92% <96.55%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bchalios
Copy link
Contributor Author

bchalios commented Oct 8, 2024

Closing this in favour of #4841 which uses the Github UI for creating the revert

@bchalios bchalios closed this Oct 8, 2024
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.

1 participant