The patch titled statistics infrastructure - update 8 has been removed from the -mm tree. Its filename is statistics-infrastructure-update-8.patch This patch was dropped because it was folded into statistics-infrastructure.patch ------------------------------------------------------ Subject: statistics infrastructure - update 8 From: Martin Peschke <mp3@xxxxxxxxxx> also calculate variance for utilisation indicator Signed-off-by: Martin Peschke <mp3@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- Documentation/statistics.txt | 1 + lib/statistic.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff -puN Documentation/statistics.txt~statistics-infrastructure-update-8 Documentation/statistics.txt --- a/Documentation/statistics.txt~statistics-infrastructure-update-8 +++ a/Documentation/statistics.txt @@ -326,6 +326,7 @@ Provides a set of values comprising: - the minimum X - the average X - the maximum X +- the variance of X This appears to be a useful fill level indicator for queues etc. diff -puN lib/statistic.c~statistics-infrastructure-update-8 lib/statistic.c --- a/lib/statistic.c~statistics-infrastructure-update-8 +++ a/lib/statistic.c @@ -903,6 +903,7 @@ struct statistic_entry_util { u32 res; u32 num; /* FIXME: better 64 bit; do_div can't deal with it) */ s64 acc; + s64 sqr; s64 min; s64 max; }; @@ -912,6 +913,7 @@ static void statistic_reset_util(struct struct statistic_entry_util *util = ptr; util->num = 0; util->acc = 0; + util->sqr = 0; util->min = LLONG_MAX; util->max = LLONG_MIN; } @@ -922,6 +924,7 @@ void statistic_add_util(struct statistic struct statistic_entry_util *util = stat->pdata->ptrs[cpu]; util->num += incr; util->acc += value * incr; + util->sqr += value * value * incr; if (unlikely(value < util->min)) util->min = value; if (unlikely(value > util->max)) @@ -935,6 +938,7 @@ static void statistic_set_util(struct st util = (struct statistic_entry_util *) stat->pdata; util->num = total; util->acc = value * total; + util->sqr = value * value * total; if (unlikely(value < util->min)) util->min = value; if (unlikely(value > util->max)) @@ -946,6 +950,7 @@ static void statistic_merge_util(struct struct statistic_entry_util *dst = _dst, *src = _src; dst->num += src->num; dst->acc += src->acc; + dst->sqr += src->sqr; if (unlikely(src->min < dst->min)) dst->min = src->min; if (unlikely(src->max > dst->max)) @@ -974,8 +979,8 @@ static int statistic_fdata_util(struct s { struct sgrb_seg *seg; struct statistic_entry_util *util = data; - unsigned long long mean_w = 0, mean_d = 0, - num = util->num, acc = util->acc; + unsigned long long mean_w = 0, mean_d = 0, var_w = 0, var_d = 0, + num = util->num, acc = util->acc, sqr = util->sqr; signed long long min = num ? util->min : 0, max = num ? util->max : 0; @@ -983,9 +988,10 @@ static int statistic_fdata_util(struct s if (unlikely(!seg)) return -ENOMEM; statistic_div(&mean_w, &mean_d, acc, num, 3); + statistic_div(&var_w, &var_d, sqr - mean_w * mean_w, num, 3); seg->offset += sprintf(seg->address + seg->offset, - "%s %Lu %Ld %Ld.%03Ld %Ld\n", name, - num, min, mean_w, mean_d, max); + "%s %Lu %Ld %Ld.%03Ld %Ld %Ld.%03Ld\n", name, + num, min, mean_w, mean_d, max, var_w, var_d); return 0; } _ Patches currently in -mm which might be from mp3@xxxxxxxxxx are statistics-infrastructure-prerequisite-list.patch statistics-infrastructure-prerequisite-parser.patch statistics-infrastructure-prerequisite-timestamp.patch statistics-infrastructure-prerequisite-timestamp-fix.patch statistics-infrastructure-make-printk_clock-a-generic-kernel-wide-nsec-resolution.patch statistics-infrastructure-documentation.patch statistics-infrastructure.patch statistics-infrastructure-update-8.patch statistics-infrastructure-exploitation-zfcp.patch statistics-infrastructure-update-5-zfcp.patch statistics-infrastructure-update-6-zfcp.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html