Skip to content

Conversation

@HuijingHei
Copy link

Just test to see if this could workaround #174

Signed-off-by: Huijing Hei <hhei@redhat.com>
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request increases the virtiofs queue size from 1024 to 4096, presumably to improve performance for storage-intensive workloads. While the change is simple, I've identified a couple of issues. First, the new queue size is a hardcoded 'magic number'; I've suggested extracting it into a constant for better maintainability. Second, and more critically, the unit tests for this functionality in test_virtiofs_filesystem_configuration within crates/kit/src/libvirt/domain.rs have not been updated to reflect this change, causing them to fail. Please update the tests to assert the new queue size of 4096.

&[("type", "mount"), ("accessmode", "passthrough")],
)?;
writer.write_empty_element("driver", &[("type", "virtiofs"), ("queue", "1024")])?;
writer.write_empty_element("driver", &[("type", "virtiofs"), ("queue", "4096")])?;

Choose a reason for hiding this comment

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

medium

The virtiofs queue size 4096 is a magic number. To improve readability and maintainability, it's best to define this as a constant. This also makes it easier to update in the future and to reference from tests.

The tests in test_virtiofs_filesystem_configuration are currently failing because they still assert the old queue size of 1024. Using a constant would help resolve this and prevent it from happening in the future.

You can add the following constant at the top of the file:

const VIRTIOFS_QUEUE_SIZE: &str = "4096";

Then, use this constant here and in the tests.

Suggested change
writer.write_empty_element("driver", &[("type", "virtiofs"), ("queue", "4096")])?;
writer.write_empty_element("driver", &[("type", "virtiofs"), ("queue", VIRTIOFS_QUEUE_SIZE)])?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't have any theory offhand why increasing the queue size here would make a difference - unless it somehow could relate to the maximum number of fds?

Either way it's probably useful to have an explicit rationale for why we picked the number. A reference to another virt framework (libvirt or systemd-vmspawn) could make sense here.

Copy link
Author

Choose a reason for hiding this comment

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

I don't have any theory offhand why increasing the queue size here would make a difference - unless it somehow could relate to the maximum number of fds?

The change was proposed by AI, and I meant want to give it a try, though I do not sure about this.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you! Looks this is not great to set to 4096, will close this and find another workaround.

Potential upside
Slight improvement only if:

- Very high parallel fs ops
- Many vCPUs (≥16–32)
- Heavy metadata churn (massive parallel builds, stress tests)

@HuijingHei HuijingHei closed this Dec 18, 2025
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.

2 participants