[PATCH v3 0/3] devfreq: improve devfreq statistics counting

From: Kamil Konieczny
Date: Thu Dec 05 2019 - 09:55:48 EST


Hi,

this patch series tries to improve devfreq statistics:

- do conversion to use 64-bit jiffies for storing elapsed time and prevent
counters overflow,

- add ability to reset statistics using sysfs,

- move statistics data to separate structure for improved code
readability and maintenance.

Changes in v3:
- changed types of cur_time and last_stats_updated to u64 as this is
returned by get_jiffies_64() in 1/3
- add checks for zero in input and clear stats only when zero is written
to trans_stats
- change documentation of trans_stat in sysfs
- removed freq_table and max_state from struct devfreq_stats as they are
already present in struct devfreq_dev_profile
- renamed last_stat_updated to last_update, as 'stat' is already present
in struct devfreq_stats
- define struct devfreq_stats stats; in devfreq as there is only one
stats per devfreq
- improve descriptions of devfreq_stats and stats
- use profile instead of devfreq->profile in devfreq_add_device, as this
var is already parameter
- added Reviewed-by: Matthias Kaehlcke <mka@xxxxxxxxxxxx> to 3/3

Changes in v2:
- added Acked-by to first patch
- dropped spinlock patch, there is mutex used for protecting stats data
- rewrite clearing statistics, suggested by Chanwoo Choi: reuse
trans_stats sysfs file, any write to it will clear devfreq stats
- dropped change var name last_stat_updated
- squashed three last patches into one, as it turned out that freq_table
from devfreq_profile is used by other drivers
- rebased on linux-next

Kamil Konieczny (3):
devfreq: change time stats to 64-bit
devfreq: add clearing transitions stats
devfreq: move statistics to separate struct

Documentation/ABI/testing/sysfs-class-devfreq | 11 ++-
drivers/devfreq/devfreq.c | 92 ++++++++++++-------
include/linux/devfreq.h | 26 ++++--
3 files changed, 83 insertions(+), 46 deletions(-)

--
2.24.0