Skip to content

Conversation

mattkur
Copy link
Contributor

@mattkur mattkur commented Oct 2, 2025

The vast majority of this work was done by @chris-oo , many thanks to him!

The outstanding queue depth from the nvme driver can be limited by the number of entries in the IO submission queue. Prior to this change, OpenHCL's nvme driver supported 1 page worth of submission queue entries. After this change, the nvme driver will support as many queue entries as the device supports.

Contiguous allocations are likely, but not strictly guaranteed. This code opts to allow forward progress by falling back to one page allocations. This is testable (and has been validated manually and with some of the existing CI tests) by not configuring a private pool.

There are some other design tradeoffs, which are noted as comments in the change.

@Copilot Copilot AI review requested due to automatic review settings October 2, 2025 03:40
@mattkur mattkur requested review from a team as code owners October 2, 2025 03:40
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the NVMe driver to support multi-page queue allocations, enabling higher queue depths and better I/O performance. The driver now attempts to allocate multi-page contiguous memory for queues while maintaining backward compatibility by falling back to single-page allocations when contiguous memory is unavailable.

Key changes:

  • Expanded queue size support from single-page to multi-page allocations
  • Added fallback mechanism for non-contiguous memory scenarios
  • Enhanced DMA allocation with private pool fallback support

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
vm/devices/storage/disk_nvme/nvme_driver/src/queue_pair.rs Core queue pair implementation with multi-page support and contiguous memory detection
vm/devices/storage/disk_nvme/nvme_driver/src/driver.rs Driver initialization updates to handle variable queue sizes
vm/devices/storage/disk_nvme/nvme_driver/src/queues.rs Queue structure updates with debug logging and completion read optimization
vm/devices/user_driver/src/memory.rs Added contiguous PFN detection utility method
openhcl/openhcl_dma_manager/src/lib.rs Enhanced DMA manager with private pool fallback allocation strategy
vmm_tests/vmm_tests/tests/tests/x86_64/openhcl_linux_direct.rs Test updates to enable VTL2 GPA pool and add cached I/O testing
openhcl/openhcl_boot/src/main.rs Boot parameter handling for NVMe keep-alive control
openhcl/openhcl_boot/src/cmdline.rs Command line parsing for NVMe keep-alive disable option
openhcl/openhcl_dma_manager/Cargo.toml Added tracing dependency for logging support
vm/devices/user_driver/src/lib.rs API documentation updates for DMA allocation

@mattkur mattkur force-pushed the contig-mem-from-chris branch from fecc9ab to 7cf0691 Compare October 2, 2025 18:50
Copy link

github-actions bot commented Oct 4, 2025

@mattkur mattkur force-pushed the contig-mem-from-chris branch from aae0062 to 2a6b151 Compare October 13, 2025 21:23
Copy link

Copy link

Copy link

Copy link

chris-oo
chris-oo previously approved these changes Oct 15, 2025
@mattkur mattkur merged commit 21923bf into microsoft:main Oct 16, 2025
71 of 73 checks passed
@mattkur mattkur deleted the contig-mem-from-chris branch October 16, 2025 15:33
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.

4 participants