Tejun Heo 304b3f2bc0 sched: Allow sched_cgroup_fork() to fail and introduce sched_cancel_fork()
A new BPF extensible sched_class will need more control over the forking
process. It wants to be able to fail from sched_cgroup_fork() after the new
task's sched_task_group is initialized so that the loaded BPF program can
prepare the task with its cgroup association is established and reject fork
if e.g. allocation fails.

Allow sched_cgroup_fork() to fail by making it return int instead of void
and adding sched_cancel_fork() to undo sched_fork() in the error path.

sched_cgroup_fork() doesn't fail yet and this patch shouldn't cause any
behavior changes.

v2: Patch description updated to detail the expected use.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: David Vernet <dvernet@meta.com>
Acked-by: Josh Don <joshdon@google.com>
Acked-by: Hao Luo <haoluo@google.com>
Acked-by: Barret Rhoden <brho@google.com>
2024-06-18 10:09:16 -10:00
..
2024-05-19 11:38:15 -07:00
2024-05-13 14:14:05 -07:00
2024-05-22 10:49:54 -07:00
2024-05-22 12:13:40 -07:00
2024-05-27 08:09:12 -07:00
2024-05-22 11:53:02 -07:00
2024-05-17 17:31:24 -07:00
2024-05-15 17:06:08 -07:00
2024-05-23 12:04:36 -07:00
2023-12-23 15:52:13 +01:00
2023-10-19 11:02:48 +02:00
2024-04-25 21:07:04 -07:00
2024-05-06 14:22:02 -06:00
2024-03-01 12:23:37 +01:00
2023-12-01 09:51:44 -08:00
2024-03-13 12:53:53 -07:00
2024-05-17 17:31:24 -07:00
2024-05-23 12:04:36 -07:00
2023-10-30 17:56:53 -10:00
2023-10-04 10:41:57 -07:00
2024-05-17 17:31:24 -07:00
2023-12-29 12:22:29 -08:00
2024-05-23 19:40:26 -07:00
2024-05-17 17:31:24 -07:00
2024-04-25 20:56:00 -07:00