• Home
  • Raw
  • Download

Lines Matching refs:pids

62 static struct pids_cgroup *parent_pids(struct pids_cgroup *pids)  in parent_pids()  argument
64 return css_pids(pids->css.parent); in parent_pids()
70 struct pids_cgroup *pids; in pids_css_alloc() local
72 pids = kzalloc(sizeof(struct pids_cgroup), GFP_KERNEL); in pids_css_alloc()
73 if (!pids) in pids_css_alloc()
76 atomic64_set(&pids->counter, 0); in pids_css_alloc()
77 atomic64_set(&pids->limit, PIDS_MAX); in pids_css_alloc()
78 atomic64_set(&pids->events_limit, 0); in pids_css_alloc()
79 return &pids->css; in pids_css_alloc()
95 static void pids_cancel(struct pids_cgroup *pids, int num) in pids_cancel() argument
101 WARN_ON_ONCE(atomic64_add_negative(-num, &pids->counter)); in pids_cancel()
109 static void pids_uncharge(struct pids_cgroup *pids, int num) in pids_uncharge() argument
113 for (p = pids; parent_pids(p); p = parent_pids(p)) in pids_uncharge()
126 static void pids_charge(struct pids_cgroup *pids, int num) in pids_charge() argument
130 for (p = pids; parent_pids(p); p = parent_pids(p)) in pids_charge()
143 static int pids_try_charge(struct pids_cgroup *pids, int num) in pids_try_charge() argument
147 for (p = pids; parent_pids(p); p = parent_pids(p)) { in pids_try_charge()
163 for (q = pids; q != p; q = parent_pids(q)) in pids_try_charge()
176 struct pids_cgroup *pids = css_pids(dst_css); in pids_can_attach() local
188 pids_charge(pids, 1); in pids_can_attach()
201 struct pids_cgroup *pids = css_pids(dst_css); in pids_cancel_attach() local
209 pids_uncharge(pids, 1); in pids_cancel_attach()
220 struct pids_cgroup *pids; in pids_can_fork() local
224 pids = css_pids(css); in pids_can_fork()
225 err = pids_try_charge(pids, 1); in pids_can_fork()
228 if (atomic64_inc_return(&pids->events_limit) == 1) { in pids_can_fork()
233 cgroup_file_notify(&pids->events_file); in pids_can_fork()
241 struct pids_cgroup *pids; in pids_cancel_fork() local
244 pids = css_pids(css); in pids_cancel_fork()
245 pids_uncharge(pids, 1); in pids_cancel_fork()
250 struct pids_cgroup *pids = css_pids(task_css(task, pids_cgrp_id)); in pids_release() local
252 pids_uncharge(pids, 1); in pids_release()
259 struct pids_cgroup *pids = css_pids(css); in pids_max_write() local
281 atomic64_set(&pids->limit, limit); in pids_max_write()
288 struct pids_cgroup *pids = css_pids(css); in pids_max_show() local
289 int64_t limit = atomic64_read(&pids->limit); in pids_max_show()
302 struct pids_cgroup *pids = css_pids(css); in pids_current_read() local
304 return atomic64_read(&pids->counter); in pids_current_read()
309 struct pids_cgroup *pids = css_pids(seq_css(sf)); in pids_events_show() local
311 seq_printf(sf, "max %lld\n", (s64)atomic64_read(&pids->events_limit)); in pids_events_show()