aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2015-08-09 07:18:54 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2015-08-09 07:20:33 -0400
commit4410877f28d1a20b5c98dd153de78c8342ac76f3 (patch)
treea16bed662be301196d94c71398e03f86f624e353
parent7ee05297e8dd04b4b0bbd34966f9d235211ada2b (diff)
Hook into kernel/exit.c to force exiting RT tasks into best-effort mode
-rw-r--r--kernel/exit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index a27a04c4fa35..07e491702a70 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -61,6 +61,8 @@
61 61
62static void exit_mm(struct task_struct *tsk); 62static void exit_mm(struct task_struct *tsk);
63 63
64#include <litmus/litmus.h>
65
64extern void exit_od_table(struct task_struct *t); 66extern void exit_od_table(struct task_struct *t);
65 67
66static void __unhash_process(struct task_struct *p, bool group_dead) 68static void __unhash_process(struct task_struct *p, bool group_dead)
@@ -667,6 +669,15 @@ void do_exit(long code)
667 if (unlikely(!tsk->pid)) 669 if (unlikely(!tsk->pid))
668 panic("Attempted to kill the idle task!"); 670 panic("Attempted to kill the idle task!");
669 671
672 if (unlikely(is_realtime(tsk))) {
673 /* We would like the task to be polite
674 * and transition out of RT mode first.
675 * Let's give it a little help.
676 */
677 litmus_do_exit(tsk);
678 BUG_ON(is_realtime(tsk));
679 }
680
670 /* 681 /*
671 * If do_exit is called because this processes oopsed, it's possible 682 * If do_exit is called because this processes oopsed, it's possible
672 * that get_fs() was left as KERNEL_DS, so reset it to USER_DS before 683 * that get_fs() was left as KERNEL_DS, so reset it to USER_DS before