Skip to content

[WIP] nvme_driver: spawn threads for device shutdown #1730

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mattkur
Copy link
Contributor

@mattkur mattkur commented Jul 18, 2025

No description provided.

@mattkur mattkur requested a review from a team as a code owner July 18, 2025 19:01
@benhillis benhillis requested a review from Copilot July 18, 2025 20:16
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 pull request modifies the NVMe device shutdown process to use separate threads for each device shutdown operation to prevent blocking the async runtime when kernel operations block.

  • Replaces direct async shutdown calls with thread-spawned shutdown operations
  • Maintains concurrent shutdown behavior while avoiding runtime blocking
  • Preserves existing tracing and error handling patterns
Comments suppressed due to low confidence (1)

openhcl/underhill_core/src/nvme_manager.rs:292

  • The variable name 'shutdown_driver' is misleading as it represents a task spawner, not a driver. Consider renaming to 'task_spawner' or 'spawner' to better reflect its purpose.
                        let shutdown_driver = self.driver_source.simple();

.collect::<Vec<_>>();

// Wait for all shutdown operations to complete
join_all(handles).await;
Copy link
Preview

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

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

The spawned tasks return JoinHandle results that need to be handled. The current code ignores potential task failures or panics. Consider using try_join_all or explicitly handling the Result from each JoinHandle to ensure shutdown errors are properly propagated.

Suggested change
join_all(handles).await;
if let Err(e) = futures::future::try_join_all(handles).await {
tracing::error!("Error during NVMe driver shutdown: {:?}", e);
}

Copilot uses AI. Check for mistakes.

@mattkur
Copy link
Contributor Author

mattkur commented Jul 18, 2025

This doesn't work. I found that the cc.en 1 -> 0, when held by a vmexit, is still serialized.

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