- while PM implements fork also for RS it needs to remember what to
schedule and what not. PM_SCHEDULED flag serves this purpose.
- PM only schedules processes that are descendaints of init, i.e. normal
user processes
- after a process is forked PM schedules for the first time only
processes that have PM_SCHEDULED set. The others are handled iether
by kernel or some other scheduler
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;
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);
#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)
if (sys_schedctl(trmp->mp_endpoint))
printf("PM: Error while overtaking scheduling for %s\n",
trmp->mp_name);
+ trmp->mp_flags |= PM_SCHEDULED;
}
}