mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #205] [MERGED] fix(ublk): gate block prewarm on resize support #250
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#250
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/205
Author: @ztting01
Created: 8/22/2026
Status: ✅ Merged
Merged: 8/24/2026
Merged by: @yingdi-shan
Base:
main← Head:fix/ublk-auto-prewarm-default📝 Commits (1)
abe0ddefix(ublk): gate block prewarm on resize support📊 Changes
4 files changed (+27 additions, -17 deletions)
View changed files
📝
config/default.toml(+3 -2)📝
docs/src/configuration/reference.md(+1 -1)📝
storage/ublk-daemon/src/main.rs(+18 -5)📝
storage/ublk-daemon/src/server.rs(+5 -9)📄 Description
What
Make block-device startup prewarm capability-aware. When
[pool.block].startup_prewarmis omitted, the ublk daemon now enables proactive refill only when the kernel reportsUBLK_F_UPDATE_SIZE. Explicittrueandfalsevalues remain authoritative.The default configuration and reference documentation now describe the capability-based default.
Why
Without
UBLK_F_UPDATE_SIZE, an idle ublk device can only be reused by a request with exactly the same virtual size.Pool watermarks are global rather than per size, while each refill batch uses one observed request size. Proactive refill can therefore fill the shared pool with one device size and prevent other sizes from being retained. Concurrent starts can amplify this because acquisitions continue growing the refill target while asynchronous refill is still in progress.
Disabling proactive refill does not disable pooling: devices returned during pause still populate the pool naturally, allowing rootfs and memory snapshot sizes to coexist and be reused by later resumes.
This is especially relevant to AgentENV's documented Linux 6.8+ baseline because upstream dynamic ublk resize was introduced later.
Related issue
Closes #203
Scope and non-goals
Included:
[pool.block].startup_prewarm.Not included:
Design and behavior changes
The daemon preserves the raw optional
startup_prewarmsetting while loading configuration. After the server probes ublk features,mainresolves the effective value as:The finalized pool configuration and detected feature flags are then passed to
enable_pool. Feature detection remains encapsulated byUblkDaemonServer;mainowns configuration resolution.On kernels without dynamic resize, omitting the setting disables proactive refill but does not disable the block-device pool: devices returned by real workloads can still remain idle and be reused by matching-size requests.
Compatibility and operations
[pool.block].startup_prewarmis now capability-based instead of alwaystrue. Explicit values are unchanged.UBLK_F_UPDATE_SIZE, upgrading stops proactive block-device refill by default. Operators can retain the previous behavior withstartup_prewarm = true.Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetCommands and results:
We compared three completed runs with proactive prewarm enabled and three with it disabled on a kernel without
UBLK_F_UPDATE_SIZE. Each run contained 128 task logs and approximately 3,400 timing samples. The values below are arithmetic means of the three per-run summaries.With prewarm enabled, 24 concurrent sandbox starts grew the asynchronous refill target to the high watermark of 64 before the first rootfs device was released. Without dynamic resize, the pool was dominated by one device size; other sizes still required new devices, and returned devices were stopped when the pool was full.
With proactive prewarm disabled, rootfs and memory snapshot devices populated the pool naturally and could both be reused by later resumes. This reduced pause overhead while also improving resume p95 and mean latency.
The refill-target amplification observed during concurrent starts is a separate issue and is not changed by this PR.
Skipped checks and reasons:
Risks and reviewer notes
The main behavioral change is limited to an omitted block-pool setting on kernels without dynamic resize. Explicit configuration provides an immediate compatibility escape hatch. Reviewers should focus on the optional-setting precedence in
storage/ublk-daemon/src/main.rsand the separation between feature detection and pool activation.Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.