lib: Proportions with flexible period
authorJan Kara <jack@suse.cz>
Thu, 24 May 2012 16:59:10 +0000 (18:59 +0200)
committerFengguang Wu <fengguang.wu@intel.com>
Fri, 8 Jun 2012 23:37:55 +0000 (08:37 +0900)
commitf3109a51f8dc88e8a94f620240b7474b91bed37a
tree5a8d0c36787f775bd552cc00ff17571e38deda9e
parentead188f9f930fb5d7f0c49315a7fce3d8bd16b7e
lib: Proportions with flexible period

Implement code computing proportions of events of different type (like code in
lib/proportions.c) but allowing periods to have different lengths. This allows
us to have aging periods of fixed wallclock time which gives better proportion
estimates given the hugely varying throughput of different devices - previous
measuring of aging period by number of events has the problem that a reasonable
period length for a system with low-end USB stick is not a reasonable period
length for a system with high-end storage array resulting either in too slow
proportion updates or too fluctuating proportion updates.

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
include/linux/flex_proportions.h [new file with mode: 0644]
lib/Makefile
lib/flex_proportions.c [new file with mode: 0644]