From: Martin Peschke <mp3@de.ibm.com>
To: Nikita Danilov <nikita@clusterfs.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Patch 5/6] statistics infrastructure
Date: Tue, 30 May 2006 13:35:40 +0200 [thread overview]
Message-ID: <447C2E0C.3050405@de.ibm.com> (raw)
In-Reply-To: <17525.25911.460120.154875@gargle.gargle.HOWL>
Nikita Danilov wrote:
> Martin Peschke writes:
> > This patch adds statistics infrastructure as common code.
> >
>
> [...]
>
> > +
> > +static void statistic_add_util(struct statistic *stat, int cpu,
> > + s64 value, u64 incr)
> > +{
> > + struct statistic_entry_util *util = stat->pdata->ptrs[cpu];
> > + util->num += incr;
> > + util->acc += value * incr;
> > + if (unlikely(value < util->min))
> > + util->min = value;
> > + if (unlikely(value > util->max))
> > + util->max = value;
>
> One useful aggregate that can be calculated here is a standard
> deviation. Something like
>
> util->acc_sq += value * incr * value * incr; /* sum of squares */
>
> And in statistic_fdata_util() squared standard deviation is
>
> std_dev = util->acc_sq;
> /*
> * Difference of averaged square and squared average.
> */
> std_dev = do_div(std_dev, util->num) - whole * whole;
>
> > +}
>
> Nikita.
Excellent idea. I will add the standard deviation.
Thanks, Martin
next prev parent reply other threads:[~2006-05-30 11:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-24 12:33 [Patch 5/6] statistics infrastructure Martin Peschke
2006-05-24 22:57 ` Andrew Morton
2006-05-29 22:17 ` Martin Peschke
2006-05-30 1:17 ` Andrew Morton
2006-05-29 22:17 ` [Patch] statistics infrastructure - update 1 Martin Peschke
2006-05-30 8:07 ` Heiko Carstens
2006-05-30 11:22 ` Martin Peschke
2006-05-30 17:17 ` [Patch 5/6] statistics infrastructure Martin Peschke
2006-05-30 19:19 ` Andrew Morton
2006-05-25 8:05 ` Nikita Danilov
2006-05-30 11:35 ` Martin Peschke [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-05-19 16:13 Martin Peschke
2005-12-16 12:27 [patch " Martin Peschke
2005-12-14 16:46 Martin Peschke
2005-12-14 18:38 ` Andi Kleen
2005-12-16 1:00 ` Martin Peschke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=447C2E0C.3050405@de.ibm.com \
--to=mp3@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nikita@clusterfs.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox