On 10 February 2014 17:15, Rob Herring <[email protected]> wrote: > This doesn't appear to be too useful. The AvgLength is large because > INT64_MAX / GTIMER_SCALE is used as the next timer value when no timer > is needed.
The code already uses timer_del() when no next timer is needed (that's the "timer disabled" case in gt_recalc_timer()). We only set the timer to INT64_MAX / GTIMER_SCALE for the case where the architecture demands an interrupt occurs in the really distant future. Admittedly the chances of QEMU still running in 200 years time are quite low, but it seemed at the time to be better to just write the code to behave correctly, since I assumed that calling timer_mod with a large timeout wasn't going to be really more expensive than calling timer_del. (Looking at the code, we end up walking the list of timers twice rather than once.) thanks -- PMM
