Lines Matching refs:cg
110 * @type: Misc res type in misc cg to cancel the charge from.
111 * @cg: Misc cgroup to cancel charge from.
116 static void misc_cg_cancel_charge(enum misc_res_type type, struct misc_cg *cg,
119 WARN_ONCE(atomic64_add_negative(-amount, &cg->res[type].usage),
127 * @cg: Misc cgroup which will be charged.
140 int misc_cg_try_charge(enum misc_res_type type, struct misc_cg *cg, u64 amount)
147 if (!(valid_type(type) && cg && READ_ONCE(misc_res_capacity[type])))
153 for (i = cg; i; i = parent_misc(i)) {
171 for (j = cg; j != i; j = parent_misc(j))
181 * @cg: Misc cgroup which will be uncharged.
186 void misc_cg_uncharge(enum misc_res_type type, struct misc_cg *cg, u64 amount)
190 if (!(amount && valid_type(type) && cg))
193 for (i = cg; i; i = parent_misc(i))
209 struct misc_cg *cg = css_misc(seq_css(sf));
214 max = READ_ONCE(cg->res[i].max);
247 struct misc_cg *cg;
277 cg = css_misc(of_css(of));
280 WRITE_ONCE(cg->res[type].max, max);
299 struct misc_cg *cg = css_misc(seq_css(sf));
302 usage = atomic64_read(&cg->res[i].usage);
336 struct misc_cg *cg = css_misc(seq_css(sf));
341 events = atomic64_read(&cg->res[i].events);
387 struct misc_cg *cg;
390 cg = &root_cg;
392 cg = kzalloc(sizeof(*cg), GFP_KERNEL);
393 if (!cg)
398 WRITE_ONCE(cg->res[i].max, MAX_NUM);
399 atomic64_set(&cg->res[i].usage, 0);
402 return &cg->css;