Hello,
We are debugging RT latency on a DRIVE AGX Thor platform and would like guidance on PCT/hypervisor scheduling parameters.
Setup
- DRIVE OS 7.0.5 (PDK 7050); Linux guest kernel 6.1.132-rt49-rt-tegra (PREEMPT_RT).
- 12-vCPU Linux guest; 14 physical CPUs.
- vCPU mapping (
pct.json):vcpu0..10 -> pCPU1..11,vcpu11 -> pCPU0. RT vCPUs arevcpu7..10 -> pCPU8..11. - No native servers are assigned to pCPU8..11 (servers are on pCPU0; DU server on pCPU2).
- Guest cmdline:
isolcpus=domain,managed_irq,7-10 nohz_full=7-10 rcu_nocbs=7-10 irqaffinity=0-6,11. - PCT
vcpu_conffor vcpu7..10:priority = 2,timeslice = 40 µs,grace_preempt_period = 10. - cyclictest:
-m -u -p 95 -a 7-10 -t 4 -i 1000 -h 200. - Background load:
stress-ng --cpu 8pinned to the housekeeping CPUs (0-6,11).
Observation 1 — HV cost on idle pCPUs
- With the isolated CPUs idle between test periods,
pct topshows HV ~0.5–0.6% on pCPU8..11, versus ~0.06–0.27% on the busy pCPU0..7. That is roughly 5 µs per 1 ms cycle of deterministic idle-path cost.
Observation 2 — removing guest idle does not remove the tail
- To remove guest idle entirely, we pinned one SCHED_OTHER spinner (
yes > /dev/null) to each of CPU7..10; the FIFO cyclictest threads preempt them. The isolated CPUs never enter cpuidle. - 79-minute run (~4.7M cycles per thread), no guest idle:
- T0: Min 5, Avg 6, Max 31 µs
- T1: Min 2, Avg 2, Max 73 µs
- T2: Min 2, Avg 4, Max 76 µs
- T3: Min 5, Avg 6, Max 78 µs
- The floor is very good (2–6 µs), but the 70–80 µs rare tail remains. In earlier timerlat runs p99.9 was ≤4 µs, so this is a rare tail, not a per-cycle cost.
- Disabling cpuidle states in the guest did not change the tail: the kernel falls back to state0 (
cpuidle_enter_stateignores the disable flag for the fallback, and guest idle is PSCI CPU_SUSPEND viapsci_idle).
Questions
- What are the recommended PCT
vcpu_conftimesliceandpriorityvalues for dedicated RT vCPUs? We currently use 40 µs (RT_VCPU_TIMESLICE) and priority 2. Could the HV preempting at 40 µs boundaries explain a 70–80 µs tail? Is there a recommended trade-off (e.g., 40 µs vs 1 ms vs 25 ms)? - Is WFI trapping configurable for dedicated vCPUs? The guest idle path uses PSCI CPU_SUSPEND (
psci_idle), so it traps to the HV regardless ofHCR_EL2.TWI. Is there a PCT/HV option to pass WFI/PSCI idle through for dedicated vCPUs, or a recommended idle configuration for RT guests? - Does Thor support the
carmel_rt_core_confforward-progress mechanism (rt_core_mask,rt_core_window_us,rt_core_forward_progress_us,is_late_rt)? Ourpct.jsoncurrently has all zeros. If supported on t264, what values are recommended for pCPU8..11, and isis_vm_rt_config_privileged/hyp_enable_rt_mode()needed? - What is the recommended way to attribute these rare 70–80 µs spikes on the HV side (hypervisor event logging / Nsight Hypervisor Trace)? We see PCPU idle/HV cycle counters in the docs; are there specific events or a capture recipe you recommend?
- Are there known limitations or recommended configurations for RT Linux guests on Thor (vCPU priority, timeslice, IRQ routing, server placement) that we should apply?
We can provide full cyclictest histograms, pct top captures, and hypervisor traces if useful.
Thanks.