Date: Tue, 24 Sep 2013 07:03:16 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255835 - head/sys/kern Message-ID: <201309240703.r8O73Gs2090696@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue Sep 24 07:03:16 2013 New Revision: 255835 URL: http://svnweb.freebsd.org/changeset/base/255835 Log: Make load average sampling asynchronous to hardclock ticks. This improves measurement of load caused by time-related events still using hardclock. For example, without this change dummynet, scheduling events each hardclock tick, was always miscounted as load of 1. There is still aliasing with events delayed by the new precision mechanism, but it probably can't be avoided without moving this sampling from using callout to some lower-level code or handling it in some other special way. Reviewed by: davide Approved by: re (marius) Modified: head/sys/kern/kern_synch.c Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Tue Sep 24 06:48:28 2013 (r255834) +++ head/sys/kern/kern_synch.c Tue Sep 24 07:03:16 2013 (r255835) @@ -570,8 +570,8 @@ loadav(void *arg) * run at regular intervals. */ callout_reset_sbt(&loadav_callout, - tick_sbt * (hz * 4 + (int)(random() % (hz * 2 + 1))), 0, - loadav, NULL, C_DIRECT_EXEC | C_HARDCLOCK); + SBT_1US * (4000000 + (int)(random() % 2000001)), SBT_1US, + loadav, NULL, C_DIRECT_EXEC | C_PREL(32)); } /* ARGSUSED */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309240703.r8O73Gs2090696>