Date: Fri, 6 Nov 2015 17:28:35 +0100 From: Hans Petter Selasky <hps@selasky.org> To: Luigi Rizzo <rizzo@iet.unipi.it> Cc: Rasool Al-Saadi <ralsaadi@swin.edu.au>, "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>, FreeBSD Current <freebsd-current@freebsd.org>, Alexander Motin <mav@FreeBSD.org> Subject: Re: Timing issue with Dummynet on high kernel timer interrupt Message-ID: <563CD533.2000909@selasky.org> In-Reply-To: <563CC186.9000807@selasky.org> References: <6545444AE21C2749939E637E56594CEA3C0DCCC4@gsp-ex02.ds.swin.edu.au> <5638B7B5.3030802@selasky.org> <6545444AE21C2749939E637E56594CEA3C0DE7FF@gsp-ex02.ds.swin.edu.au> <563B2703.5080402@selasky.org> <6545444AE21C2749939E637E56594CEA3C0E0BD9@gsp-ex02.ds.swin.edu.au> <563C6864.2090907@selasky.org> <CA%2BhQ2%2Bhm2z0MkB-8w5xJM7%2Biz13r_ZjwmpZBnb30_D_48gaf-w@mail.gmail.com> <563C786C.1050305@selasky.org> <CA%2BhQ2%2Bj0WiGgzV119M1ZQiXP5Z7fq7deVxDPkOhvTc7hpTETKw@mail.gmail.com> <563CC186.9000807@selasky.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?563CD533.2000909>