Re: Timing issue with Dummynet on high kernel timer interrupt

From: Ian Lepore <ian_at_freebsd.org>
Date: Fri, 06 Nov 2015 09:43:49 -0700
On Fri, 2015-11-06 at 17:28 +0100, Hans Petter Selasky wrote:
> Hi,
> 
> I spent some time to write a test application to investigate this
> issue 
> and I found some irregularities, that when
> kern.eventtimer.periodic=0, 
> the timer appears to run very irregular.
> 
> Test software:
> ==============
> 
> fetch 
> http://home.selasky.org:8192/privat/callout_test_dummynet.tar.gz
> tar -zxvf callout_test_dummynet.tar.gz
> cd callout_test_dummynet
> make -m /usr/src/share/mk SYSDIR=/usr/src/sys all install
> 
> Test I:
> =======
> 
> The following settings are placed in /boot/loader.conf and computer 
> rebooted.
> kern.hz=10000
> kern.eventtimer.periodic=1
> 
> kldload callout_test
> 
> ./test.sh
> debug.total: 32604 -> 0
> debug.total: 10021 -> 0
> debug.total: 10020 -> 0
> debug.total: 10020 -> 0
> debug.total: 10020 -> 0
> debug.total: 10020 -> 0
> debug.total: 10020 -> 0
> debug.total: 10020 -> 0
> debug.total: 10019 -> 0
> debug.total: 10021 -> 0
> debug.total: 10020 -> 0
> debug.total: 10021 -> 0
> debug.total: 10019 -> 0
> debug.total: 10020 -> 0
> debug.total: 10018 -> 0
> debug.total: 10021 -> 0
> debug.total: 10020 -> 0
> debug.total: 10020 -> 0
> debug.total: 10020 -> 0
> debug.total: 10020 -> 0
> debug.total: 10020 -> 0
> debug.total: 10020 -> 0
> debug.total: 10020 -> 0
> debug.total: 10020 -> 0
> 
> Test II:
> ========
> 
> The following settings are placed in /boot/loader.conf and computer 
> rebooted.
> kern.hz=10000
> kern.eventtimer.periodic=0
> 
> kldload callout_test
> 
> ./test.sh
> debug.total: 20337 -> 0
> debug.total: 10091 -> 0
> debug.total: 10018 -> 1
> debug.total: 10041 -> 0
> debug.total: 10019 -> 0
> debug.total: 10644 -> 0
> debug.total: 10014 -> 1
> debug.total: 10020 -> 0
> debug.total: 10019 -> 0
> debug.total: 10644 -> 0
> debug.total: 10014 -> 0
> debug.total: 10644 -> 0
> debug.total: 10640 -> 0
> debug.total: 10210 -> 0
> debug.total: 10015 -> 0
> debug.total: 10020 -> 1
> debug.total: 10020 -> 0
> debug.total: 10453 -> 0
> debug.total: 10642 -> 0
> 
> If you load the computer, like a multi-CPU buildkernel, the value 
> flattens out again.
> 
> Test III:
> =========
> The following settings are placed in /boot/loader.conf and computer 
> rebooted.
> kern.hz=1000
> kern.eventtimer.periodic=1
> 
> kldload callout_test
> 
> ./test.sh
> debug.total: 5238 -> 0
> debug.total: 1005 -> 0
> debug.total: 1003 -> 0
> debug.total: 1006 -> 0
> debug.total: 1003 -> 0
> debug.total: 1003 -> 0
> debug.total: 1005 -> 0
> debug.total: 1006 -> 0
> debug.total: 1003 -> 0
> debug.total: 1013 -> 0
> debug.total: 1005 -> 0
> debug.total: 1006 -> 0
> debug.total: 1004 -> 0
> debug.total: 1005 -> 0
> debug.total: 1003 -> 0
> debug.total: 1004 -> 0
> debug.total: 1006 -> 0
> debug.total: 1004 -> 0
> debug.total: 1004 -> 0
> debug.total: 1007 -> 0
> debug.total: 1003 -> 0
> debug.total: 1004 -> 0
> 
> 
> The difference between 100021 and 10642 interrupts in a second for
> test 
> II is quite big, close to 6.5% deviation. Does anyone have any clue
> if 
> this is the expected behaviour when kern.eventtimer.periodic=1 or
> not?
> 
> MAV ?
> 
> --HPS

Do the test II results change with this setting?

  sysctl kern.timecounter.alloweddeviation=0

-- Ian
Received on Fri Nov 06 2015 - 15:43:53 UTC

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