From 904531a6321964579ab0972a8833616e97dbf582 Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Sat, 29 Jan 2011 20:31:57 -0500 Subject: bugfix: don't let children stay Litmus real-time tasks It has always been LITMUS^RT policy that children of real-time tasks may not skip the admissions test, etc. This used to be enforced, but was apparently dropped during some port. This commit re-introduces this policy. This fixes a kernel panic that occurred when "real-time children" exited without proper initilization. --- litmus/litmus.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'litmus') diff --git a/litmus/litmus.c b/litmus/litmus.c index 8efd3f9ef7ee..11ccaafd50de 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c @@ -292,9 +292,6 @@ static void reinit_litmus_state(struct task_struct* p, int restore) */ WARN_ON(p->rt_param.inh_task); - /* We need to restore the priority of the task. */ -// __setscheduler(p, p->rt_param.old_policy, p->rt_param.old_prio); XXX why is this commented? - /* Cleanup everything else. */ memset(&p->rt_param, 0, sizeof(p->rt_param)); @@ -437,10 +434,12 @@ out: */ void litmus_fork(struct task_struct* p) { - if (is_realtime(p)) + if (is_realtime(p)) { /* clean out any litmus related state, don't preserve anything */ reinit_litmus_state(p, 0); - else + /* Don't let the child be a real-time task. */ + p->sched_reset_on_fork = 1; + } else /* non-rt tasks might have ctrl_page set */ tsk_rt(p)->ctrl_page = NULL; -- cgit v1.2.2