mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
sched: Add exports tracking cfs bandwidth control statistics
This change introduces statistics exports for the cpu sub-system, these are added through the use of a stat file similar to that exported by other subsystems. The following exports are included: nr_periods: number of periods in which execution occurred nr_throttled: the number of periods above in which execution was throttle throttled_time: cumulative wall-time that any cpus have been throttled for this group Signed-off-by: Paul Turner <[email protected]> Signed-off-by: Nikhil Rao <[email protected]> Signed-off-by: Bharata B Rao <[email protected]> Reviewed-by: Hidetoshi Seto <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
d3d9dc3302
commit
e8da1b18b3
2 changed files with 28 additions and 0 deletions
|
|
@ -262,6 +262,9 @@ struct cfs_bandwidth {
|
|||
struct hrtimer period_timer;
|
||||
struct list_head throttled_cfs_rq;
|
||||
|
||||
/* statistics */
|
||||
int nr_periods, nr_throttled;
|
||||
u64 throttled_time;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
@ -402,6 +405,7 @@ struct cfs_rq {
|
|||
u64 runtime_expires;
|
||||
s64 runtime_remaining;
|
||||
|
||||
u64 throttled_timestamp;
|
||||
int throttled, throttle_count;
|
||||
struct list_head throttled_list;
|
||||
#endif
|
||||
|
|
@ -9397,6 +9401,19 @@ static int __cfs_schedulable(struct task_group *tg, u64 period, u64 quota)
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int cpu_stats_show(struct cgroup *cgrp, struct cftype *cft,
|
||||
struct cgroup_map_cb *cb)
|
||||
{
|
||||
struct task_group *tg = cgroup_tg(cgrp);
|
||||
struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(tg);
|
||||
|
||||
cb->fill(cb, "nr_periods", cfs_b->nr_periods);
|
||||
cb->fill(cb, "nr_throttled", cfs_b->nr_throttled);
|
||||
cb->fill(cb, "throttled_time", cfs_b->throttled_time);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_CFS_BANDWIDTH */
|
||||
#endif /* CONFIG_FAIR_GROUP_SCHED */
|
||||
|
||||
|
|
@ -9443,6 +9460,10 @@ static struct cftype cpu_files[] = {
|
|||
.read_u64 = cpu_cfs_period_read_u64,
|
||||
.write_u64 = cpu_cfs_period_write_u64,
|
||||
},
|
||||
{
|
||||
.name = "stat",
|
||||
.read_map = cpu_stats_show,
|
||||
},
|
||||
#endif
|
||||
#ifdef CONFIG_RT_GROUP_SCHED
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue