diff --git a/servers/pm/forkexit.c b/servers/pm/forkexit.c index 3406296c2..17a8c9f8d 100644 --- a/servers/pm/forkexit.c +++ b/servers/pm/forkexit.c @@ -92,7 +92,7 @@ PUBLIC int do_fork() sigemptyset(&rmc->mp_sigtrace); } /* Inherit only these flags. In normal fork(), PRIV_PROC is not inherited. */ - rmc->mp_flags &= (IN_USE|DELAY_CALL); + rmc->mp_flags &= (IN_USE|DELAY_CALL|PM_SCHEDULED); rmc->mp_child_utime = 0; /* reset administration */ rmc->mp_child_stime = 0; /* reset administration */ rmc->mp_exitstatus = 0; diff --git a/servers/pm/main.c b/servers/pm/main.c index 2fdafbb93..41d3c4106 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -505,7 +505,8 @@ PRIVATE void handle_fs_reply() case PM_FORK_REPLY: /* Schedule the newly created process ... */ - schedule_process(rmp); + if (rmp->mp_flags & PM_SCHEDULED) + schedule_process(rmp); /* ... and wake it up */ setreply(proc_n, OK); diff --git a/servers/pm/mproc.h b/servers/pm/mproc.h index 358e93e50..bb4cbf7bb 100644 --- a/servers/pm/mproc.h +++ b/servers/pm/mproc.h @@ -82,6 +82,7 @@ EXTERN struct mproc { #define TRACE_EXIT 0x08000 /* tracer is forcing this process to exit */ #define TRACE_ZOMBIE 0x10000 /* waiting for tracer to issue WAIT call */ #define DELAY_CALL 0x20000 /* waiting for call before sending signal */ +#define PM_SCHEDULED 0x40000 /* this process is scheduled by PM */ #define NIL_MPROC ((struct mproc *) 0) diff --git a/servers/pm/schedule.c b/servers/pm/schedule.c index 590ce45d2..2f6ee3d24 100644 --- a/servers/pm/schedule.c +++ b/servers/pm/schedule.c @@ -69,6 +69,7 @@ PUBLIC void overtake_scheduling(void) if (sys_schedctl(trmp->mp_endpoint)) printf("PM: Error while overtaking scheduling for %s\n", trmp->mp_name); + trmp->mp_flags |= PM_SCHEDULED; } }