Skip to main content

hold_parked

Function hold_parked 

Source
pub fn hold_parked(ctx: &ServiceContext, d: Budget)
Expand description

Hold for at least d, PARKED: sleep through it, then spin out whatever the sleep left. For holds of tens of milliseconds - a USB reset, a debounce - where the core matters more than waking on the microsecond.

A hold that long spins the whole time, and a driver that holds often pays for it: ehci, which holds 50 and 100 ms on every turn of its rescan loop, read 100% of a core in observe with nothing plugged in until it learned to park. The sleep can wake late by up to a quantum, which a MINIMUM allows; the spin covers a sleep that woke early, so the hold is never short on a calibrated machine. On an uncalibrated one it is hold’s whole quanta.