Lines Matching refs:cg

100 static void misc_cg_cancel_charge(enum misc_res_type type, struct misc_cg *cg,  in misc_cg_cancel_charge()  argument
103 WARN_ONCE(atomic64_add_negative(-amount, &cg->res[type].usage), in misc_cg_cancel_charge()
121 static void misc_cg_event(enum misc_res_type type, struct misc_cg *cg) in misc_cg_event() argument
123 atomic64_inc(&cg->res[type].events_local); in misc_cg_event()
124 cgroup_file_notify(&cg->events_local_file); in misc_cg_event()
126 for (; parent_misc(cg); cg = parent_misc(cg)) { in misc_cg_event()
127 atomic64_inc(&cg->res[type].events); in misc_cg_event()
128 cgroup_file_notify(&cg->events_file); in misc_cg_event()
148 int misc_cg_try_charge(enum misc_res_type type, struct misc_cg *cg, u64 amount) in misc_cg_try_charge() argument
155 if (!(valid_type(type) && cg && READ_ONCE(misc_res_capacity[type]))) in misc_cg_try_charge()
161 for (i = cg; i; i = parent_misc(i)) { in misc_cg_try_charge()
177 for (j = cg; j != i; j = parent_misc(j)) in misc_cg_try_charge()
192 void misc_cg_uncharge(enum misc_res_type type, struct misc_cg *cg, u64 amount) in misc_cg_uncharge() argument
196 if (!(amount && valid_type(type) && cg)) in misc_cg_uncharge()
199 for (i = cg; i; i = parent_misc(i)) in misc_cg_uncharge()
215 struct misc_cg *cg = css_misc(seq_css(sf)); in misc_cg_max_show() local
220 max = READ_ONCE(cg->res[i].max); in misc_cg_max_show()
253 struct misc_cg *cg; in misc_cg_max_write() local
283 cg = css_misc(of_css(of)); in misc_cg_max_write()
286 WRITE_ONCE(cg->res[type].max, max); in misc_cg_max_write()
305 struct misc_cg *cg = css_misc(seq_css(sf)); in misc_cg_current_show() local
308 usage = atomic64_read(&cg->res[i].usage); in misc_cg_current_show()
328 struct misc_cg *cg = css_misc(seq_css(sf)); in misc_cg_peak_show() local
331 watermark = atomic64_read(&cg->res[i].watermark); in misc_cg_peak_show()
365 struct misc_cg *cg = css_misc(seq_css(sf)); in __misc_events_show() local
371 events = atomic64_read(&cg->res[i].events_local); in __misc_events_show()
373 events = atomic64_read(&cg->res[i].events); in __misc_events_show()
439 struct misc_cg *cg; in misc_cg_alloc() local
442 cg = &root_cg; in misc_cg_alloc()
444 cg = kzalloc(sizeof(*cg), GFP_KERNEL); in misc_cg_alloc()
445 if (!cg) in misc_cg_alloc()
450 WRITE_ONCE(cg->res[i].max, MAX_NUM); in misc_cg_alloc()
451 atomic64_set(&cg->res[i].usage, 0); in misc_cg_alloc()
454 return &cg->css; in misc_cg_alloc()