[Bug 173541] High (0.60+, 1.00) idle load averages

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 23 Jan 2023 02:16:45 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=173541

--- Comment #38 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
(In reply to Stavros Filargyropoulos from comment #37)

5 seconds intervals for sampling, sampling 6 intervals,
spans 30 seconds, not 60 seconds.

For arithmetic mean=0.2 over 12 values, that would mean that the
total of the 12 values would be 2.4 . (But the code does not use
the arithmetic mean, so that is only suggestive.)

I still do not see how this is to be classified as unreasonable
for the background activity present, even if it was an arithmetic
mean.


You may want to ignore the following . . .

But it does not keep track of the 12 values for a minute
and then find the arithmetic mean: "average" here is more
complicated.

For i==0 (i.e., the 1 minute context), first setting up
context for the code later quoted:

cexp[i] is listed as: 0.9200444146293232 * FSCALE,    /* exp(-1/12) */
The 0.9200444146293232 is for the exp(-1/12) and the 12
looks to be from 5sec * 12 == 60 sec. FSCALE is 2048.
2048 in turn is 1<<FSCALE, with FSCALE==11.

Given all that, the new-sample update looks like (i==0 for
the 1 minute context):
avg->ldavg[i] = (cexp[i] * avg->ldavg[i] +
                 nrun * FSCALE * (FSCALE - cexp[i]))
                >> FSHIFT;

nrun is the new sample.

It does not look like a uniform 1 minute average. More like
a figure for which the contribution of the nrun values from
more than 12 steps back just have a small influence on the
value. Even the various 12 more recent nrun values do not
look to have a uniform influence on the result, just larger
than the older ones. (Not a very detailed classification,
sorry.)

-- 
You are receiving this mail because:
You are the assignee for the bug.