mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[GH-ISSUE #333] perf(ublk): default ublk block devices to the none I/O scheduler #85
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#85
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?
Originally created by @odysseusy on GitHub (Oct 1, 2026).
Original GitHub issue: https://github.com/kvcache-ai/AgentENV/issues/333
Affected component
ublk / ublk-daemon (host setup)
Problem statement
Every ublk device AgentENV creates has one hardware queue, so the kernel attaches
mq-deadlineto/dev/ublkbNby default. ublk forwards each request to the userspace overlaybd target, which does its own ordering, so the elevator adds only per-request locking and dispatch overhead. On Linux 7.2 and later the cost is much larger: commit 9cbbac29d752 ("block: Remove redundant plug in __submit_bio()") makes every direct I/O to a device with an elevator dispatch asynchronously through kblockd, which adds a context switch per request.Measured on
uvm-ublkfrom v0.2.3 (6cccaa7):--direct=1 --ioengine=io_uring --bs=4k.Use case
Any host running sandboxes on ublk-backed rootfs or extra drives. Small random I/O from the guest is the common case for agent workloads.
Current behavior and workarounds
Devices come up with
mq-deadline. An operator can add their own udev rule or writequeue/schedulerby hand, but nothing in AgentENV does it. The daemon runs as an unprivileged user and can't write sysfs.Desired behavior
New
/dev/ublkb*devices use thenonescheduler before the daemon hands them out.Proposed approach
server --setup-hostalready installs/etc/udev/rules.d/99-agentenv-ublk.rulesto grant device access. Add one line to it, and toscripts/tests/setup-ublk-access.sh:udev applies the attribute in the same event that sets the node's group. The daemon runs without CAP_DAC_OVERRIDE, so
wait_for_ublk_dev()can't open the node before that event, and the scheduler is alreadynoneby then. I checked this on 10 devices with the production privilege model (non-root user with CAP_SYS_ADMIN and CAP_NET_ADMIN).A patch is ready if this approach is acceptable.
Compatibility and operational impact
Alternatives considered
BLK_MQ_F_NO_SCHED_BY_DEFAULT, like loop and null_blk, is under review upstream. It won't reach the 6.x kernels that hosts run today.Non-goals
Tuning other queue attributes, and changing the scheduler of non-ublk devices. This is independent of the userspace weighted I/O scheduling proposed in #47, which runs inside the daemon.