diff options
| author | Tejun Heo <tj@kernel.org> | 2018-04-26 17:29:05 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2018-04-26 17:29:05 -0400 |
| commit | 6162cef0f741c70eb0c7ac7e6142f85808d8abc4 (patch) | |
| tree | 355935993063eb4aa28ff6e8491d40380a83db7f /include/linux/cgroup.h | |
| parent | a17556f8d9798e8feff9e34d746e489e78ee1dab (diff) | |
cgroup: Factor out and expose cgroup_rstat_*() interface functions
cgroup_rstat is being generalized so that controllers can use it too.
This patch factors out and exposes the following interface functions.
* cgroup_rstat_updated(): Renamed from cgroup_rstat_cpu_updated() for
consistency.
* cgroup_rstat_flush_hold/release(): Factored out from base stat
implementation.
* cgroup_rstat_flush(): Verbatim expose.
While at it, drop assert on cgroup_rstat_mutex in
cgroup_base_stat_flush() as it crosses layers and make a minor comment
update.
v2: Added EXPORT_SYMBOL_GPL(cgroup_rstat_updated) to fix a build bug.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/cgroup.h')
| -rw-r--r-- | include/linux/cgroup.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 473e0c0abb86..5c6018fef5aa 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -690,11 +690,18 @@ static inline void cgroup_path_from_kernfs_id(const union kernfs_node_id *id, | |||
| 690 | char *buf, size_t buflen) {} | 690 | char *buf, size_t buflen) {} |
| 691 | #endif /* !CONFIG_CGROUPS */ | 691 | #endif /* !CONFIG_CGROUPS */ |
| 692 | 692 | ||
| 693 | #ifdef CONFIG_CGROUPS | ||
| 693 | /* | 694 | /* |
| 694 | * Basic resource stats. | 695 | * cgroup scalable recursive statistics. |
| 695 | */ | 696 | */ |
| 696 | #ifdef CONFIG_CGROUPS | 697 | void cgroup_rstat_updated(struct cgroup *cgrp, int cpu); |
| 698 | void cgroup_rstat_flush(struct cgroup *cgrp); | ||
| 699 | void cgroup_rstat_flush_hold(struct cgroup *cgrp); | ||
| 700 | void cgroup_rstat_flush_release(void); | ||
| 697 | 701 | ||
| 702 | /* | ||
| 703 | * Basic resource stats. | ||
| 704 | */ | ||
| 698 | #ifdef CONFIG_CGROUP_CPUACCT | 705 | #ifdef CONFIG_CGROUP_CPUACCT |
| 699 | void cpuacct_charge(struct task_struct *tsk, u64 cputime); | 706 | void cpuacct_charge(struct task_struct *tsk, u64 cputime); |
| 700 | void cpuacct_account_field(struct task_struct *tsk, int index, u64 val); | 707 | void cpuacct_account_field(struct task_struct *tsk, int index, u64 val); |
