Lines Matching full:ca
42 static inline struct cpuacct *parent_ca(struct cpuacct *ca) in parent_ca() argument
44 return css_ca(ca->css.parent); in parent_ca()
57 struct cpuacct *ca; in cpuacct_css_alloc() local
62 ca = kzalloc(sizeof(*ca), GFP_KERNEL); in cpuacct_css_alloc()
63 if (!ca) in cpuacct_css_alloc()
66 ca->cpuusage = alloc_percpu(u64); in cpuacct_css_alloc()
67 if (!ca->cpuusage) in cpuacct_css_alloc()
70 ca->cpustat = alloc_percpu(struct kernel_cpustat); in cpuacct_css_alloc()
71 if (!ca->cpustat) in cpuacct_css_alloc()
74 return &ca->css; in cpuacct_css_alloc()
77 free_percpu(ca->cpuusage); in cpuacct_css_alloc()
79 kfree(ca); in cpuacct_css_alloc()
87 struct cpuacct *ca = css_ca(css); in cpuacct_css_free() local
89 free_percpu(ca->cpustat); in cpuacct_css_free()
90 free_percpu(ca->cpuusage); in cpuacct_css_free()
91 kfree(ca); in cpuacct_css_free()
94 static u64 cpuacct_cpuusage_read(struct cpuacct *ca, int cpu, in cpuacct_cpuusage_read() argument
97 u64 *cpuusage = per_cpu_ptr(ca->cpuusage, cpu); in cpuacct_cpuusage_read()
98 u64 *cpustat = per_cpu_ptr(ca->cpustat, cpu)->cpustat; in cpuacct_cpuusage_read()
135 static void cpuacct_cpuusage_write(struct cpuacct *ca, int cpu) in cpuacct_cpuusage_write() argument
137 u64 *cpuusage = per_cpu_ptr(ca->cpuusage, cpu); in cpuacct_cpuusage_write()
138 u64 *cpustat = per_cpu_ptr(ca->cpustat, cpu)->cpustat; in cpuacct_cpuusage_write()
141 if (ca == &root_cpuacct) in cpuacct_cpuusage_write()
164 struct cpuacct *ca = css_ca(css); in __cpuusage_read() local
169 totalcpuusage += cpuacct_cpuusage_read(ca, i, index); in __cpuusage_read()
194 struct cpuacct *ca = css_ca(css); in cpuusage_write() local
204 cpuacct_cpuusage_write(ca, cpu); in cpuusage_write()
212 struct cpuacct *ca = css_ca(seq_css(m)); in __cpuacct_percpu_seq_show() local
217 percpu = cpuacct_cpuusage_read(ca, i, index); in __cpuacct_percpu_seq_show()
241 struct cpuacct *ca = css_ca(seq_css(m)); in cpuacct_all_seq_show() local
254 cpuacct_cpuusage_read(ca, cpu, index)); in cpuacct_all_seq_show()
262 struct cpuacct *ca = css_ca(seq_css(sf)); in cpuacct_stats_show() local
270 u64 *cpustat = per_cpu_ptr(ca->cpustat, cpu)->cpustat; in cpuacct_stats_show()
278 cputime.sum_exec_runtime += *per_cpu_ptr(ca->cpuusage, cpu); in cpuacct_stats_show()
337 struct cpuacct *ca; in cpuacct_charge() local
341 for (ca = task_ca(tsk); ca; ca = parent_ca(ca)) in cpuacct_charge()
342 *per_cpu_ptr(ca->cpuusage, cpu) += cputime; in cpuacct_charge()
352 struct cpuacct *ca; in cpuacct_account_field() local
354 for (ca = task_ca(tsk); ca != &root_cpuacct; ca = parent_ca(ca)) in cpuacct_account_field()
355 __this_cpu_add(ca->cpustat->cpustat[index], val); in cpuacct_account_field()