[go: nahoru, domu]

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

VirtIO optimizations #177

Merged
merged 9 commits into from
Feb 27, 2024
Merged

VirtIO optimizations #177

merged 9 commits into from
Feb 27, 2024

Conversation

slp
Copy link
Contributor
@slp slp commented Feb 26, 2024

Originally, libkrun was designed to prioritize having a minimal footprint. With newer use cases, we need to find a balance between being small and lean and being performant. In this series, we move the heavy hitters (block, net and fs) to their own threads, which reduces the latency and prevents them from starving each other.

We also adopt EVENT_IDX to reduce the signal traffic between the guest and the host and update EDK2 to remove the boot wait, along other minor optimizations in virtio-net.

Import event_idx functionality from rust-vmm's virtio-queue. This
feature allows us to reduce the number of signals sent between the guest
and the host.

Signed-off-by: Sergio Lopez <slp@redhat.com>
@slp slp force-pushed the virtio-optimizations branch 2 times, most recently from 2dfef38 to 3fdc93b Compare February 26, 2024 21:04
Move the work to a separate thread. This reduces the operation latency,
minimizes the noise between devices and allows us to implement more
aggressive optimization strategies.

While there, also adopt the EVENT_IDX to reduce the notification traffic
between the guest and the host.

Signed-off-by: Sergio Lopez <slp@redhat.com>
Increase SNDBUF and RCVBUF to the maximum allowed by default on macOS.

Signed-off-by: Sergio Lopez <slp@redhat.com>
Increase queue size to 1024. This minimizes the chances of dropping
incoming packets.

Signed-off-by: Sergio Lopez <slp@redhat.com>
virtio-block can support large segment numbers (visible in Linux as
"max_segments") by putting more than one data descriptor in the
descriptor chain. So far, we only supported a single data descriptor,
which on Linux implies "max_segments == 1".

In this commit we reuse the Reader/Writer abstractions that have been
used by virtio/fs for very long to be able to easily digest large
descriptor chains, and we extend VirtioBlkConfig to declare that we
support up to 254 (QUEUE_SIZE - 2) segments.

This provides a huge performance boost for both reading and writing
large chunks of data.

While there, also implement support for EVENT_IDX to reduce the traffic
of signals between the guest and the host.

Signed-off-by: Sergio Lopez <slp@redhat.com>
Move the work to a separate thread. This reduces the operation latency,
minimizes the noise between devices and allows us to implement more
aggressive optimization strategies.

Signed-off-by: Sergio Lopez <slp@redhat.com>
Move the work to a separate thread. This reduces the operation latency,
minimizes the noise between devices and allows us to implement more
aggressive optimization strategies.

Signed-off-by: Sergio Lopez <slp@redhat.com>
Update binary built from
tianocore/edk2@fc0b5a6

Signed-off-by: Sergio Lopez <slp@redhat.com>
This release includes optimizations on the main virtio devices (net,
blk and fs).

Signed-off-by: Sergio Lopez <slp@redhat.com>
@slp slp marked this pull request as ready for review February 26, 2024 23:09
@slp slp merged commit b09abe9 into containers:main Feb 27, 2024
5 checks passed
@slp slp deleted the virtio-optimizations branch February 27, 2024 11:15
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.

None yet

1 participant