From: Nikita Danilov <nikita@clusterfs.com>
To: Martin Peschke <mp3@de.ibm.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Patch 5/6] statistics infrastructure
Date: Thu, 25 May 2006 12:05:11 +0400 [thread overview]
Message-ID: <17525.25911.460120.154875@gargle.gargle.HOWL> (raw)
In-Reply-To: <1148474038.2934.18.camel@dyn-9-152-230-71.boeblingen.de.ibm.com>
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.
next prev parent reply other threads:[~2006-05-25 8:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-24 12:33 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 [this message]
2006-05-30 11:35 ` Martin Peschke
-- 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=17525.25911.460120.154875@gargle.gargle.HOWL \
--to=nikita@clusterfs.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mp3@de.ibm.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
all inboxes | Powered by JetHome®