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 */ _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"