From: Ben Gras Date: Wed, 19 May 2010 13:22:29 +0000 (+0000) Subject: pm - fix sched interaction X-Git-Tag: v3.1.7~44 X-Git-Url: http://zhaoyanbai.com/repos/%22/xml/v3/zones/static/%7B%24global.css%7D?a=commitdiff_plain;h=bcdaf033b586069d048a8d8dd06d700ca6fec281;p=minix.git pm - fix sched interaction For coredumping processes, PM forgets to inform SCHED that the process has vanished, causing future fork()s to fail. --- diff --git a/servers/pm/forkexit.c b/servers/pm/forkexit.c index 3406296c2..a7900800f 100644 --- a/servers/pm/forkexit.c +++ b/servers/pm/forkexit.c @@ -364,6 +364,17 @@ int dump_core; /* flag indicating whether to dump core */ */ int r; + if((r = sched_stop(rmp)) != OK) { + /* If the scheduler refuses to give up scheduling, there is + * little we can do, except report it. This may cause problems + * later on, if this scheduler is asked to schedule another proc + * that has an endpoint->schedproc mapping identical to the proc + * we just tried to stop scheduling. + */ + printf("PM: The scheduler did not want to give up " + "scheduling %s, ret=%d.\n", rmp->mp_name, r); + } + /* For core dumps, now is the right time to try to contact the parent. */ if (dump_core) zombify(rmp); diff --git a/servers/pm/main.c b/servers/pm/main.c index 6047e382c..d2a55320c 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -479,17 +479,6 @@ PRIVATE void handle_fs_reply() break; case PM_EXIT_REPLY: - if((r = sched_stop(rmp)) != OK) { - /* If the scheduler refuses to give up scheduling, there is - * little we can do, except report it. This may cause problems - * later on, if this scheduler is asked to schedule another proc - * that has an endpoint->schedproc mapping identical to the proc - * we just tried to stop scheduling. - */ - printf("PM: The scheduler did not want to give up " - "scheduling %s, ret=%d.\n", rmp->mp_name, r); - } - exit_restart(rmp, FALSE /*dump_core*/); break;