Lines Matching refs:it
245 static void css_task_iter_skip(struct css_task_iter *it,
884 struct css_task_iter *it, *pos; in css_set_skip_task_iters() local
886 list_for_each_entry_safe(it, pos, &cset->task_iters, iters_node) in css_set_skip_task_iters()
887 css_task_iter_skip(it, task); in css_set_skip_task_iters()
1835 struct css_task_iter *it; in rebind_subsystems() local
1865 list_for_each_entry(it, &cset->task_iters, iters_node) in rebind_subsystems()
1866 if (it->cset_head == &scgrp->e_csets[ss->id]) in rebind_subsystems()
1867 it->cset_head = &dcgrp->e_csets[ss->id]; in rebind_subsystems()
3958 struct css_task_iter it; in __cgroup_kill() local
3967 css_task_iter_start(&cgrp->self, CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED, &it); in __cgroup_kill()
3968 while ((task = css_task_iter_next(&it))) { in __cgroup_kill()
3979 css_task_iter_end(&it); in __cgroup_kill()
4762 static struct css_set *css_task_iter_next_css_set(struct css_task_iter *it) in css_task_iter_next_css_set() argument
4771 if (it->tcset_pos) { in css_task_iter_next_css_set()
4772 l = it->tcset_pos->next; in css_task_iter_next_css_set()
4774 if (l != it->tcset_head) { in css_task_iter_next_css_set()
4775 it->tcset_pos = l; in css_task_iter_next_css_set()
4780 it->tcset_pos = NULL; in css_task_iter_next_css_set()
4784 l = it->cset_pos; in css_task_iter_next_css_set()
4786 if (l == it->cset_head) { in css_task_iter_next_css_set()
4787 it->cset_pos = NULL; in css_task_iter_next_css_set()
4791 if (it->ss) { in css_task_iter_next_css_set()
4792 cset = container_of(l, struct css_set, e_cset_node[it->ss->id]); in css_task_iter_next_css_set()
4798 it->cset_pos = l; in css_task_iter_next_css_set()
4801 if (it->flags & CSS_TASK_ITER_THREADED) { in css_task_iter_next_css_set()
4802 if (it->cur_dcset) in css_task_iter_next_css_set()
4803 put_css_set_locked(it->cur_dcset); in css_task_iter_next_css_set()
4804 it->cur_dcset = cset; in css_task_iter_next_css_set()
4807 it->tcset_head = &cset->threaded_csets; in css_task_iter_next_css_set()
4808 it->tcset_pos = &cset->threaded_csets; in css_task_iter_next_css_set()
4820 static void css_task_iter_advance_css_set(struct css_task_iter *it) in css_task_iter_advance_css_set() argument
4827 while ((cset = css_task_iter_next_css_set(it))) { in css_task_iter_advance_css_set()
4829 it->cur_tasks_head = &cset->tasks; in css_task_iter_advance_css_set()
4832 it->cur_tasks_head = &cset->mg_tasks; in css_task_iter_advance_css_set()
4835 it->cur_tasks_head = &cset->dying_tasks; in css_task_iter_advance_css_set()
4840 it->task_pos = NULL; in css_task_iter_advance_css_set()
4843 it->task_pos = it->cur_tasks_head->next; in css_task_iter_advance_css_set()
4860 if (it->cur_cset) { in css_task_iter_advance_css_set()
4861 list_del(&it->iters_node); in css_task_iter_advance_css_set()
4862 put_css_set_locked(it->cur_cset); in css_task_iter_advance_css_set()
4865 it->cur_cset = cset; in css_task_iter_advance_css_set()
4866 list_add(&it->iters_node, &cset->task_iters); in css_task_iter_advance_css_set()
4869 static void css_task_iter_skip(struct css_task_iter *it, in css_task_iter_skip() argument
4874 if (it->task_pos == &task->cg_list) { in css_task_iter_skip()
4875 it->task_pos = it->task_pos->next; in css_task_iter_skip()
4876 it->flags |= CSS_TASK_ITER_SKIPPED; in css_task_iter_skip()
4880 static void css_task_iter_advance(struct css_task_iter *it) in css_task_iter_advance() argument
4886 if (it->task_pos) { in css_task_iter_advance()
4892 if (it->flags & CSS_TASK_ITER_SKIPPED) in css_task_iter_advance()
4893 it->flags &= ~CSS_TASK_ITER_SKIPPED; in css_task_iter_advance()
4895 it->task_pos = it->task_pos->next; in css_task_iter_advance()
4897 if (it->task_pos == &it->cur_cset->tasks) { in css_task_iter_advance()
4898 it->cur_tasks_head = &it->cur_cset->mg_tasks; in css_task_iter_advance()
4899 it->task_pos = it->cur_tasks_head->next; in css_task_iter_advance()
4901 if (it->task_pos == &it->cur_cset->mg_tasks) { in css_task_iter_advance()
4902 it->cur_tasks_head = &it->cur_cset->dying_tasks; in css_task_iter_advance()
4903 it->task_pos = it->cur_tasks_head->next; in css_task_iter_advance()
4905 if (it->task_pos == &it->cur_cset->dying_tasks) in css_task_iter_advance()
4906 css_task_iter_advance_css_set(it); in css_task_iter_advance()
4909 css_task_iter_advance_css_set(it); in css_task_iter_advance()
4912 if (!it->task_pos) in css_task_iter_advance()
4915 task = list_entry(it->task_pos, struct task_struct, cg_list); in css_task_iter_advance()
4917 if (it->flags & CSS_TASK_ITER_PROCS) { in css_task_iter_advance()
4923 if (it->cur_tasks_head == &it->cur_cset->dying_tasks && in css_task_iter_advance()
4928 if (it->cur_tasks_head == &it->cur_cset->dying_tasks) in css_task_iter_advance()
4945 struct css_task_iter *it) in css_task_iter_start() argument
4947 memset(it, 0, sizeof(*it)); in css_task_iter_start()
4951 it->ss = css->ss; in css_task_iter_start()
4952 it->flags = flags; in css_task_iter_start()
4954 if (CGROUP_HAS_SUBSYS_CONFIG && it->ss) in css_task_iter_start()
4955 it->cset_pos = &css->cgroup->e_csets[css->ss->id]; in css_task_iter_start()
4957 it->cset_pos = &css->cgroup->cset_links; in css_task_iter_start()
4959 it->cset_head = it->cset_pos; in css_task_iter_start()
4961 css_task_iter_advance(it); in css_task_iter_start()
4974 struct task_struct *css_task_iter_next(struct css_task_iter *it) in css_task_iter_next() argument
4976 if (it->cur_task) { in css_task_iter_next()
4977 put_task_struct(it->cur_task); in css_task_iter_next()
4978 it->cur_task = NULL; in css_task_iter_next()
4984 if (it->flags & CSS_TASK_ITER_SKIPPED) in css_task_iter_next()
4985 css_task_iter_advance(it); in css_task_iter_next()
4987 if (it->task_pos) { in css_task_iter_next()
4988 it->cur_task = list_entry(it->task_pos, struct task_struct, in css_task_iter_next()
4990 get_task_struct(it->cur_task); in css_task_iter_next()
4991 css_task_iter_advance(it); in css_task_iter_next()
4996 return it->cur_task; in css_task_iter_next()
5005 void css_task_iter_end(struct css_task_iter *it) in css_task_iter_end() argument
5007 if (it->cur_cset) { in css_task_iter_end()
5009 list_del(&it->iters_node); in css_task_iter_end()
5010 put_css_set_locked(it->cur_cset); in css_task_iter_end()
5014 if (it->cur_dcset) in css_task_iter_end()
5015 put_css_set(it->cur_dcset); in css_task_iter_end()
5017 if (it->cur_task) in css_task_iter_end()
5018 put_task_struct(it->cur_task); in css_task_iter_end()
5046 struct css_task_iter *it = &ctx->procs.iter; in __cgroup_procs_start() local
5055 css_task_iter_start(&cgrp->self, iter_flags, it); in __cgroup_procs_start()
5058 css_task_iter_end(it); in __cgroup_procs_start()
5059 css_task_iter_start(&cgrp->self, iter_flags, it); in __cgroup_procs_start()
5061 return it->cur_task; in __cgroup_procs_start()