aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/cpuacct.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched/cpuacct.c')
-rw-r--r--kernel/sched/cpuacct.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
index 1b784d9b3630..f64722ff0299 100644
--- a/kernel/sched/cpuacct.c
+++ b/kernel/sched/cpuacct.c
@@ -38,12 +38,6 @@ static inline struct cpuacct *css_ca(struct cgroup_subsys_state *css)
38 return css ? container_of(css, struct cpuacct, css) : NULL; 38 return css ? container_of(css, struct cpuacct, css) : NULL;
39} 39}
40 40
41/* return cpu accounting group corresponding to this container */
42static inline struct cpuacct *cgroup_ca(struct cgroup *cgrp)
43{
44 return css_ca(cgroup_css(cgrp, cpuacct_subsys_id));
45}
46
47/* return cpu accounting group to which this task belongs */ 41/* return cpu accounting group to which this task belongs */
48static inline struct cpuacct *task_ca(struct task_struct *tsk) 42static inline struct cpuacct *task_ca(struct task_struct *tsk)
49{ 43{
@@ -138,9 +132,9 @@ static void cpuacct_cpuusage_write(struct cpuacct *ca, int cpu, u64 val)
138} 132}
139 133
140/* return total cpu usage (in nanoseconds) of a group */ 134/* return total cpu usage (in nanoseconds) of a group */
141static u64 cpuusage_read(struct cgroup *cgrp, struct cftype *cft) 135static u64 cpuusage_read(struct cgroup_subsys_state *css, struct cftype *cft)
142{ 136{
143 struct cpuacct *ca = cgroup_ca(cgrp); 137 struct cpuacct *ca = css_ca(css);
144 u64 totalcpuusage = 0; 138 u64 totalcpuusage = 0;
145 int i; 139 int i;
146 140
@@ -150,10 +144,10 @@ static u64 cpuusage_read(struct cgroup *cgrp, struct cftype *cft)
150 return totalcpuusage; 144 return totalcpuusage;
151} 145}
152 146
153static int cpuusage_write(struct cgroup *cgrp, struct cftype *cftype, 147static int cpuusage_write(struct cgroup_subsys_state *css, struct cftype *cft,
154 u64 reset) 148 u64 reset)
155{ 149{
156 struct cpuacct *ca = cgroup_ca(cgrp); 150 struct cpuacct *ca = css_ca(css);
157 int err = 0; 151 int err = 0;
158 int i; 152 int i;
159 153
@@ -169,10 +163,10 @@ out:
169 return err; 163 return err;
170} 164}
171 165
172static int cpuacct_percpu_seq_read(struct cgroup *cgroup, struct cftype *cft, 166static int cpuacct_percpu_seq_read(struct cgroup_subsys_state *css,
173 struct seq_file *m) 167 struct cftype *cft, struct seq_file *m)
174{ 168{
175 struct cpuacct *ca = cgroup_ca(cgroup); 169 struct cpuacct *ca = css_ca(css);
176 u64 percpu; 170 u64 percpu;
177 int i; 171 int i;
178 172
@@ -189,10 +183,10 @@ static const char * const cpuacct_stat_desc[] = {
189 [CPUACCT_STAT_SYSTEM] = "system", 183 [CPUACCT_STAT_SYSTEM] = "system",
190}; 184};
191 185
192static int cpuacct_stats_show(struct cgroup *cgrp, struct cftype *cft, 186static int cpuacct_stats_show(struct cgroup_subsys_state *css,
193 struct cgroup_map_cb *cb) 187 struct cftype *cft, struct cgroup_map_cb *cb)
194{ 188{
195 struct cpuacct *ca = cgroup_ca(cgrp); 189 struct cpuacct *ca = css_ca(css);
196 int cpu; 190 int cpu;
197 s64 val = 0; 191 s64 val = 0;
198 192