From owner-freebsd-current Tue Jul 17 13:19: 9 2001 Delivered-To: freebsd-current@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id DE4EC37B40E for ; Tue, 17 Jul 2001 13:19:03 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from gosset.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 17 Jul 2001 21:19:03 +0100 (BST) To: Bruce Evans Cc: freebsd-current@FreeBSD.ORG Subject: Re: Load average synchronisation and phantom loads In-Reply-To: Your message of "Wed, 18 Jul 2001 03:19:48 +1000." Date: Tue, 17 Jul 2001 21:19:00 +0100 From: Ian Dowse Message-ID: <200107172119.aa30092@salmon.maths.tcd.ie> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message , Bruce Ev ans writes: > >I think that is far too much variation. 5 seconds is hard-coded into >the computation of the load average (constants in cexp[]), so even a >variation of +-1 ticks breaks the computation slightly. I have not changed the mean inter-sample time from 5 seconds (*), so is this really a problem? There will be a slight time-warping effect in the load calculation, but even for the shorter 5-minute timescale, this will average out to typically no more than a few percent (i.e the "5 minutes" will instead normally be approx 4.8 to 5.2 minutes). Apart from a marginally more wobbley xload display, this should not make any real difference. If the variation was much smaller than it is in the proposed patch, you could get a noticable drifting in and out of phase with processes that have a regular run-pause pattern. Obviously this is a much bigger problem when the sample period is fixed like it is now, but I wanted to minimise the possibility of this effect while keeping the inter-update time "relatively" constant. The alternative that I considered was to sample the processes once during every 5-second interval, but to place the sampling point randomly over the interval. That probably results in a better synchronisation-avoidance behaviour. However, to incorporate the sample into the load average requires either waiting until the end of the interval, or updating the load average at the time of sampling. The former introduces a new delay into the load average computation, and the latter results in a lot of very noticable jitter on the inter-sample interval. (*) Actually, I have changed the mean by 0.5 ticks, but that is a bug that I will fix. The "4 + random() % (hz * 2)" should be "4 + random() % (hz * 2 + 1)" instead. >Not another SYSINIT (all SYSINITs are evil IMO). SI_SUB_PSEUDO is >bogus here -- there are no pseudo ttys here. sched_setup() is a >good place to do this initialization. John Baldwin suggested moving the load average calculation into kern_synch.c, so it would certainly make sense to initialise it from sched_setup() then. This seems like a good idea to me; does that sound OK? Ian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message