aboutsummaryrefslogtreecommitdiffstats
path: root/litmus
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2015-10-06 15:46:48 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2016-03-08 10:12:47 -0500
commit32784b4fa49490442727c29b4e3b2a75b89bfc69 (patch)
treececa541c6e63cb4abf61478f097e4799f01436e1 /litmus
parentaa87f5a3b279b14cdd9dd618137cc2698eacc5d9 (diff)
LITMUS^RT: Enable plugins to permit RT tasks to fork
Diffstat (limited to 'litmus')
-rw-r--r--litmus/litmus.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/litmus/litmus.c b/litmus/litmus.c
index aaa1cacd99d6..ed739082af5b 100644
--- a/litmus/litmus.c
+++ b/litmus/litmus.c
@@ -533,14 +533,24 @@ int switch_sched_plugin(struct sched_plugin* plugin)
533 */ 533 */
534void litmus_fork(struct task_struct* p) 534void litmus_fork(struct task_struct* p)
535{ 535{
536 /* non-rt tasks might have ctrl_page set */
537 tsk_rt(p)->ctrl_page = NULL;
538
536 if (is_realtime(p)) { 539 if (is_realtime(p)) {
537 /* clean out any litmus related state, don't preserve anything */ 540 reinit_litmus_state(p, 1);
538 reinit_litmus_state(p, 0); 541 if (litmus->fork_task(p)) {
539 /* Don't let the child be a real-time task. */ 542 if (__litmus_admit_task(p))
540 p->sched_reset_on_fork = 1; 543 /* something went wrong, give up */
541 } else 544 p->sched_reset_on_fork = 1;
542 /* non-rt tasks might have ctrl_page set */ 545 } else {
543 tsk_rt(p)->ctrl_page = NULL; 546 /* clean out any litmus related state */
547 reinit_litmus_state(p, 0);
548
549 TRACE_TASK(p, "fork: real-time status denied\n");
550 /* Don't let the child be a real-time task. */
551 p->sched_reset_on_fork = 1;
552 }
553 }
544 554
545 /* od tables are never inherited across a fork */ 555 /* od tables are never inherited across a fork */
546 p->od_table = NULL; 556 p->od_table = NULL;