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-balloon driver #1439

Merged
merged 2 commits into from
Mar 29, 2021
Merged

virtio-balloon driver #1439

merged 2 commits into from
Mar 29, 2021

Conversation

wjhun
Copy link
Contributor

@wjhun wjhun commented Mar 23, 2021

This adds a driver for the virtio-balloon device, allowing the monitor to manage the memory footprint of a Nanos instance by inflating and deflating balloon pages. The driver responds to changes applied to the balloon device's PCI config space, which is managed by registration of a handler via a newly-added vtpci_register_config_change_handler interface. An interface has also been added to allow mm_service() to deflate balloon pages when memory resources are at a minimum.

To accommodate config change interrupts for non-MSIX platforms, the non-MSIX vtpci interrupt handler is now registered only once per device and, upon invocation, dispatches queue and config change handlers based on pending bits in the ISR status register.

This driver supports the "statsq," if offered by the device, which reports memory usage, page faults and pagecache usage to the monitor when requested.

Resolves #660

This adds a driver for the virtio-balloon device, allowing the
hypervisor/monitor to manage the memory footprint of a VM instance by
inflating and deflating balloon pages. The driver responds to changes applied
to the balloon device's PCI config space, which is managed by registration of
a handler via a newly-added vtpci_register_config_change_handler interface. An
interface has also been added to allow mm_service() to deflate balloon pages
when memory resources are at a minimum.

To accommodate config change interrupts for non-MSIX platforms, the non-MSIX
vtpci interrupt handler is registered only once per device and, upon
invocation, dispatches queue and config change handlers based on pending bits
in the ISR status register.
@wjhun wjhun requested a review from a team March 23, 2021 23:44
@sanderssj
Copy link
Collaborator

Looks okay to me!

src/virtio/virtio_pci.c Outdated Show resolved Hide resolved
src/virtio/virtio_balloon.c Outdated Show resolved Hide resolved
src/virtio/virtio_balloon.c Outdated Show resolved Hide resolved
src/virtio/virtio_balloon.c Outdated Show resolved Hide resolved
src/virtio/virtio_balloon.c Outdated Show resolved Hide resolved
…nnot be fully met on inflation, and add some simple usage documentation
@wjhun wjhun merged commit 0f74764 into master Mar 29, 2021
@wjhun wjhun deleted the virtio-balloon branch June 17, 2021 13:55
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.

implement a virtio balloon device driver
3 participants