Re: Timing issue with Dummynet on high kernel timer interrupt

From: Ian Lepore <ian_at_freebsd.org>
Date: Fri, 06 Nov 2015 10:23:05 -0700
On Fri, 2015-11-06 at 17:57 +0100, Hans Petter Selasky wrote:
> On 11/06/15 17:51, Hans Petter Selasky wrote:
> > On 11/06/15 17:43, Ian Lepore wrote:
> > > On Fri, 2015-11-06 at 17:28 +0100, Hans Petter Selasky wrote:
> > > > Hi,
> > 
> > > 
> > > Do the test II results change with this setting?
> > > 
> > >    sysctl kern.timecounter.alloweddeviation=0
> > > 
> > 
> > Yes, it looks much better:
> > 
> > debug.total: 10013 -> 0
> > debug.total: 10013 -> 0
> > debug.total: 10012 -> 0
> > debug.total: 10012 -> 0
> > debug.total: 10012 -> 0
> > debug.total: 10013 -> 0
> > debug.total: 10012 -> 1
> > debug.total: 10013 -> 0
> > debug.total: 10013 -> 0
> > debug.total: 10013 -> 0
> > debug.total: 10012 -> 0
> > debug.total: 10013 -> 0
> > debug.total: 10013 -> 0
> > 
> > --HPS
> > 
> 
> Thought I still see some unexpected dips, as the test runs for a
> longer 
> amount of time. Not sure what the cause might be.
> 
> > debug.total: 10013 -> 0
> > debug.total: 10013 -> 0
> > debug.total: 10013 -> 0
> > debug.total: 9844 -> 0
> > debug.total: 10013 -> 0
> > debug.total: 10013 -> 0
> > debug.total: 10012 -> 0
> 
> --HPS

Is it possible your machine is occasionally falling into a deeper sleep
state (C3 or whatever)?  I think it can take hundreds of microseconds
to wake up from some of the deeper power-saving modes.

If not power-saving, just plain old system-is-busy could lead to the
reduced counts occasionally, since each callout is scheduled as a delta
from the current actual wakeup time, not a delta from the current
scheduled wakeup time (i.e., there is a phase shift in the firing of
events over time).  Raising the priority of the test thread into the
realtime range might help with system-busy variation.

It's also a bit iffy that you're using eventtimers to measure the
performance of eventtimers (by using sleep 1 in the script).  That
explains the +12/13 count every second, not the reduced counts unless
we speculate that sleep is returning early (which I have NEVER caught
it doing).  If you have a PPS source available, that can make a good
way to sleep based on an off-box timing signal and avoid using a clock
to measure itself.  But I doubt it would make a big difference in this
case.

-- Ian
Received on Fri Nov 06 2015 - 16:23:08 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:00 UTC