Skip to content

nvme_driver: add admin pending command tracing#3070

Merged
gurasinghMS merged 10 commits intomicrosoft:mainfrom
gurasinghMS:add-admin-pending-command-tracing
Mar 26, 2026
Merged

nvme_driver: add admin pending command tracing#3070
gurasinghMS merged 10 commits intomicrosoft:mainfrom
gurasinghMS:add-admin-pending-command-tracing

Conversation

@gurasinghMS
Copy link
Copy Markdown
Contributor

Adds some tracing only for pending commands on the admin queue and how long we have waited for them at the time of save.

@gurasinghMS gurasinghMS requested review from a team as code owners March 19, 2026 21:14
Copilot AI review requested due to automatic review settings March 19, 2026 21:14
Copy link
Copy Markdown
Contributor

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

Adds diagnostic tracing to the NVMe driver to help understand when admin-queue commands are still pending at save time (and for how long), plus a small test failure-message cleanup.

Changes:

  • Track an issued_at timestamp for pending admin-queue commands.
  • Emit tracing events for pending admin commands during QueueHandler::save().
  • Update a vmm_test assertion message to avoid hard-coding a specific timeout value.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs Updates an assertion message to reference the configured timeout rather than a specific duration.
vm/devices/storage/disk_nvme/nvme_driver/src/queue_pair.rs Adds per-command timing for admin-queue pending commands and attempts to log pending durations at save time.

Comment thread vm/devices/storage/disk_nvme/nvme_driver/src/queue_pair.rs
Copy link
Copy Markdown
Contributor

@alandau alandau left a comment

Choose a reason for hiding this comment

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

A few small comments, the main one being about the eager evaluation.

Comment thread vm/devices/storage/disk_nvme/nvme_driver/src/queue_pair.rs Outdated
Comment thread vm/devices/storage/disk_nvme/nvme_driver/src/queue_pair.rs Outdated
Comment thread vm/devices/storage/disk_nvme/nvme_driver/src/queue_pair.rs
Copilot AI review requested due to automatic review settings March 20, 2026 17:40
Comment thread vm/devices/storage/disk_nvme/nvme_driver/src/queue_pair.rs Outdated
Comment thread vm/devices/storage/disk_nvme/nvme_driver/src/queue_pair.rs Outdated
Copy link
Copy Markdown
Contributor

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

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

Comment on lines +953 to +954
#[inspect(with = "|x| x.map(|elapsed| elapsed.elapsed().as_secs_f64())")]
elapsed: Option<Instant>,
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The elapsed field actually stores a submission timestamp (Instant), not an elapsed duration. This is confusing (especially with the inspect formatter computing elapsed() on it). Consider renaming the field to something like submitted_at/submitted_instant (or similar) and update the logging/inspect label accordingly so the name matches the stored value.

Suggested change
#[inspect(with = "|x| x.map(|elapsed| elapsed.elapsed().as_secs_f64())")]
elapsed: Option<Instant>,
#[inspect(with = "|x| x.map(|instant| instant.elapsed().as_secs_f64())")]
submitted_at: Option<Instant>,

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@alandau on the topic of naming here: naming it "submitted_at" but having inspect log the elapsed time doesn't make much sense. What do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can call the field submitted_at, and rename the field only for inspect: #inspect[with = "....", rename = "elapsed"]. Good idea on printing elapsed rather than the instant.
BTW, I'm wary of using floats for time sensitive things (which might not be the case here, since we're doing this only for admin commands, but still). We can do e.g. .as_millis() as u64. A u64 millis should last for a bazillion years. Up to you.

Comment thread vm/devices/storage/disk_nvme/nvme_driver/src/queue_pair.rs
Comment thread vm/devices/storage/disk_nvme/nvme_driver/src/queue_pair.rs
@github-actions
Copy link
Copy Markdown

Copilot AI review requested due to automatic review settings March 20, 2026 20:28
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread vm/devices/storage/disk_nvme/nvme_driver/src/queue_pair.rs
Copy link
Copy Markdown
Contributor

@alandau alandau left a comment

Choose a reason for hiding this comment

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

Looks good, thanks

@gurasinghMS gurasinghMS merged commit bf84896 into microsoft:main Mar 26, 2026
57 checks passed
moor-coding pushed a commit to moor-coding/openvmm that referenced this pull request Mar 26, 2026
Adds some tracing only for pending commands on the admin queue and how
long we have waited for them at the time of save.
moor-coding pushed a commit to moor-coding/openvmm that referenced this pull request Apr 13, 2026
Adds some tracing only for pending commands on the admin queue and how
long we have waited for them at the time of save.
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.

3 participants