While WSL2 provides a convenient development environment, it introduces several artifacts that make microsecond-scale latency attribution unreliable:
- Hypervisor Scheduling: The WSL2 VM is subject to the Windows host scheduler. A kernel
thread (like
io_uringSQPOLL) may be de-scheduled by the host, leading to artificial tail latency. - IPI and Interrupt Latency: Signal delivery between the virtualized Linux kernel and the host hardware is not zero-cost.
- Clock Source Jitter: While
CLOCK_MONOTONIC_RAWis used, the virtualization layer can still introduce micro-jitter.
To definitively prove the project's thesis, we must measure on bare-metal Linux.
- Bare-metal Linux: No virtual machine or hypervisor (KVM/Hyper-V).
- CPU Isolation: Target core is isolated via
isolcpusor at least idle. - Fixed Frequency: CPU frequency scaling (Intel P-States/AMD PBO) is disabled.
- Tools Ready:
bpftraceandgccare installed and functional. - No Background Load: No heavy compilation or I/O occurring during measurement.
- Kernel: Linux >= 5.15 (for reliable
io_uringtracepoints). - Access: Root/Sudo (required for
bpftraceandtaskset). - Isolation: Support for
tasksetorisolcpus.
# Pin to core 0 (or any isolated core)
taskset -c 0 ./scripts/run_existing_fastpath_validation.sh 10000sudo bpftrace trace/bpf/io_uring_latency.bt > trace_attribution.log./benchmarks/io_uring_real --workload=sram20 --mode=A --iters=10000We want to quantify the time spent in each segment:
- submit → issue: Submission side overhead (system call + request prep).
- issue → complete: The "Hardware" time (simulated by 20µs busy-wait).
- complete → wakeup: Kernel completion posting and waitqueue signal.
- wakeup → sched-in: From kernel wakeup to the user process running.
- If a gap exists:
complete → wakeuporwakeup → sched-inwill be large relative to the 20µs compute time. - If not: Existing
io_uringAPIs are sufficient for deterministic workloads.
We will only proceed with experimental patches if:
complete → wakeupdominates the p99 tail (> 5-10µs residual).wakeup → sched-inis relatively small, indicating the process is ready but the kernel is slow to notify.- Userspace is actively polling but still incurs high kernel overhead.