Lines Matching refs:cg

104 static void misc_cg_cancel_charge(enum misc_res_type type, struct misc_cg *cg,  in misc_cg_cancel_charge()  argument
107 WARN_ONCE(atomic64_add_negative(-amount, &cg->res[type].usage), in misc_cg_cancel_charge()
125 static void misc_cg_event(enum misc_res_type type, struct misc_cg *cg) in misc_cg_event() argument
127 atomic64_inc(&cg->res[type].events_local); in misc_cg_event()
128 cgroup_file_notify(&cg->events_local_file); in misc_cg_event()
130 for (; parent_misc(cg); cg = parent_misc(cg)) { in misc_cg_event()
131 atomic64_inc(&cg->res[type].events); in misc_cg_event()
132 cgroup_file_notify(&cg->events_file); in misc_cg_event()
152 int misc_cg_try_charge(enum misc_res_type type, struct misc_cg *cg, u64 amount) in misc_cg_try_charge() argument
159 if (!(valid_type(type) && cg && READ_ONCE(misc_res_capacity[type]))) in misc_cg_try_charge()
165 for (i = cg; i; i = parent_misc(i)) { in misc_cg_try_charge()
181 for (j = cg; j != i; j = parent_misc(j)) in misc_cg_try_charge()
196 void misc_cg_uncharge(enum misc_res_type type, struct misc_cg *cg, u64 amount) in misc_cg_uncharge() argument
200 if (!(amount && valid_type(type) && cg)) in misc_cg_uncharge()
203 for (i = cg; i; i = parent_misc(i)) in misc_cg_uncharge()
219 struct misc_cg *cg = css_misc(seq_css(sf)); in misc_cg_max_show() local
224 max = READ_ONCE(cg->res[i].max); in misc_cg_max_show()
257 struct misc_cg *cg; in misc_cg_max_write() local
287 cg = css_misc(of_css(of)); in misc_cg_max_write()
290 WRITE_ONCE(cg->res[type].max, max); in misc_cg_max_write()
309 struct misc_cg *cg = css_misc(seq_css(sf)); in misc_cg_current_show() local
312 usage = atomic64_read(&cg->res[i].usage); in misc_cg_current_show()
332 struct misc_cg *cg = css_misc(seq_css(sf)); in misc_cg_peak_show() local
335 watermark = atomic64_read(&cg->res[i].watermark); in misc_cg_peak_show()
369 struct misc_cg *cg = css_misc(seq_css(sf)); in __misc_events_show() local
375 events = atomic64_read(&cg->res[i].events_local); in __misc_events_show()
377 events = atomic64_read(&cg->res[i].events); in __misc_events_show()
443 struct misc_cg *cg; in misc_cg_alloc() local
446 cg = &root_cg; in misc_cg_alloc()
448 cg = kzalloc(sizeof(*cg), GFP_KERNEL); in misc_cg_alloc()
449 if (!cg) in misc_cg_alloc()
454 WRITE_ONCE(cg->res[i].max, MAX_NUM); in misc_cg_alloc()
455 atomic64_set(&cg->res[i].usage, 0); in misc_cg_alloc()
458 return &cg->css; in misc_cg_alloc()