Lines Matching +full:signal +full:- +full:group

1 // SPDX-License-Identifier: GPL-2.0
4 * Auto-group scheduling implementation:
38 init_task->signal->autogroup = &autogroup_default; in autogroup_init()
44 kfree(tg->autogroup); in autogroup_free()
52 /* We've redirected RT tasks to the root task group... */ in autogroup_destroy()
53 ag->tg->rt_se = NULL; in autogroup_destroy()
54 ag->tg->rt_rq = NULL; in autogroup_destroy()
56 sched_release_group(ag->tg); in autogroup_destroy()
57 sched_destroy_group(ag->tg); in autogroup_destroy()
62 kref_put(&ag->kref, autogroup_destroy); in autogroup_kref_put()
67 kref_get(&ag->kref); in autogroup_kref_get()
79 ag = autogroup_kref_get(p->signal->autogroup); in autogroup_task_get()
97 kref_init(&ag->kref); in autogroup_create()
98 init_rwsem(&ag->lock); in autogroup_create()
99 ag->id = atomic_inc_return(&autogroup_seq_nr); in autogroup_create()
100 ag->tg = tg; in autogroup_create()
103 * Autogroup RT tasks are redirected to the root task group in autogroup_create()
110 tg->rt_se = root_task_group.rt_se; in autogroup_create()
111 tg->rt_rq = root_task_group.rt_rq; in autogroup_create()
113 tg->autogroup = ag; in autogroup_create()
135 * value of signal->autogroup but in this case sched_move_task() will in task_wants_autogroup()
139 * to avoid autogroup->tg, so we abuse PF_EXITING flag for this case. in task_wants_autogroup()
141 if (p->flags & PF_EXITING) in task_wants_autogroup()
151 * see this thread after that: we can no longer use signal->autogroup. in sched_autogroup_exit_task()
167 prev = p->signal->autogroup; in autogroup_move_group()
173 p->signal->autogroup = autogroup_kref_get(ag); in autogroup_move_group()
175 * We can't avoid sched_move_task() after we changed signal->autogroup, in autogroup_move_group()
176 * this process can already run with task_group() == prev->tg or we can in autogroup_move_group()
177 * race with cgroup code which can read autogroup = prev under rq->lock. in autogroup_move_group()
180 * can't be removed from thread list, we hold ->siglock. in autogroup_move_group()
213 sig->autogroup = autogroup_task_get(current); in sched_autogroup_fork()
218 autogroup_kref_put(sig->autogroup); in sched_autogroup_exit()
239 return -EINVAL; in proc_sched_autogroup_set_nice()
246 return -EPERM; in proc_sched_autogroup_set_nice()
250 return -EAGAIN; in proc_sched_autogroup_set_nice()
258 down_write(&ag->lock); in proc_sched_autogroup_set_nice()
259 err = sched_group_set_shares(ag->tg, shares); in proc_sched_autogroup_set_nice()
261 ag->nice = nice; in proc_sched_autogroup_set_nice()
262 up_write(&ag->lock); in proc_sched_autogroup_set_nice()
273 if (!task_group_is_autogroup(ag->tg)) in proc_sched_autogroup_show_task()
276 down_read(&ag->lock); in proc_sched_autogroup_show_task()
277 seq_printf(m, "/autogroup-%ld nice %d\n", ag->id, ag->nice); in proc_sched_autogroup_show_task()
278 up_read(&ag->lock); in proc_sched_autogroup_show_task()
290 return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id); in autogroup_path()