From 8330b6cc7ea3c9b181957fdc6cf96ca2d495613c Mon Sep 17 00:00:00 2001 From: FKHals <5229803-FKHals@users.noreply.gitlab.com> Date: Wed, 27 Sep 2023 10:58:04 +0200 Subject: [PATCH] Set job child process default scheduler to PB at fork (and not later on as before) which fixes a bug where child processes that have been initially run by the CFS would somehow remain in its queue and would get scheduled even though they are dead which causes critical errors. --- kernel/sched/core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index b36b08325c04..964c5fac143e 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2367,6 +2367,12 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p) p->sched_class = &fair_sched_class; } + // schedule a pb process only using the pb-scheduler and thereby avoid that the process is + // inserted into the CFS data structures + if (PB_EXEC_MODE == this_rq()->pb.mode) { + p->sched_class = &pb_sched_class; + } + init_entity_runnable_average(&p->se); /* -- GitLab