perf(quickemu): improve disk I/O defaults (cache,aio)#1837
Merged
flexiondotorg merged 1 commit intomasterfrom Jan 25, 2026
Merged
perf(quickemu): improve disk I/O defaults (cache,aio)#1837flexiondotorg merged 1 commit intomasterfrom
flexiondotorg merged 1 commit intomasterfrom
Conversation
- add cache=writeback and aio=threads to DRIVE_OPTIMISATIONS - retain existing optimisations: discard=unmap,detect-zeroes=unmap - improve write performance (host writeback caching) and async I/O parallelism via thread-based AIO - follows Proxmox/libvirt QEMU disk best practices; researched for macOS but applies to all guests Signed-off-by: Martin Wimpress <martin@wimpress.org>
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 3/5
- Defaulting to
cache=writebackinquickemucan increase data-loss risk on host failure because writes may be acknowledged before reaching storage - Score reflects a concrete user-impact risk (data integrity) with moderate severity, even though scope is limited to disk cache defaults
- Pay close attention to
quickemu- default disk cache behavior could lead to data loss on crashes
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="quickemu">
<violation number="1" location="quickemu:1892">
P2: Setting `cache=writeback` as a default for all VM disks increases the risk of data loss on host failures (docs warn that writeback reports writes complete before they hit storage). Consider leaving cache unspecified or using a safer mode by default and making writeback opt‑in.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap" | ||
| # Optimise disk I/O: enable TRIM/discard, zero detection for thin provisioning, | ||
| # writeback caching and threaded async I/O | ||
| DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap,cache=writeback,aio=threads" |
Contributor
There was a problem hiding this comment.
P2: Setting cache=writeback as a default for all VM disks increases the risk of data loss on host failures (docs warn that writeback reports writes complete before they hit storage). Consider leaving cache unspecified or using a safer mode by default and making writeback opt‑in.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At quickemu, line 1892:
<comment>Setting `cache=writeback` as a default for all VM disks increases the risk of data loss on host failures (docs warn that writeback reports writes complete before they hit storage). Consider leaving cache unspecified or using a safer mode by default and making writeback opt‑in.</comment>
<file context>
@@ -1887,8 +1887,9 @@ function vm_boot() {
- DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap"
+ # Optimise disk I/O: enable TRIM/discard, zero detection for thin provisioning,
+ # writeback caching and threaded async I/O
+ DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap,cache=writeback,aio=threads"
if [[ "${boot}" == *"efi"* ]]; then
</file context>
Suggested change
| DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap,cache=writeback,aio=threads" | |
| DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap,aio=threads" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Checklist: