aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2014-06-02 08:22:02 -0400
committerNamhoon Kim <namhoonk@cs.unc.edu>2014-10-21 10:08:10 -0400
commitd14164377790b4c15fd1fa4665329f6e6febe78f (patch)
tree8143ba947fd4a6c8039a353ff4104f818f9b8722
parent232ab01e5abd3bf3b494f46d558898122d57f6d8 (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 ab36666c0875..2fc678f64854 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -59,6 +59,8 @@
59#include <asm/pgtable.h> 59#include <asm/pgtable.h>
60#include <asm/mmu_context.h> 60#include <asm/mmu_context.h>
61 61
62#include <litmus/litmus.h>
63
62extern void exit_od_table(struct task_struct *t); 64extern void exit_od_table(struct task_struct *t);
63 65
64static void exit_mm(struct task_struct * tsk); 66static void exit_mm(struct task_struct * tsk);
@@ -720,6 +722,15 @@ void do_exit(long code)
720 if (unlikely(!tsk->pid)) 722 if (unlikely(!tsk->pid))
721 panic("Attempted to kill the idle task!"); 723 panic("Attempted to kill the idle task!");
722 724
725 if (unlikely(is_realtime(tsk))) {
726 /* We would like the task to be polite
727 * and transition out of RT mode first.
728 * Let's give it a little help.
729 */
730 litmus_do_exit(tsk);
731 BUG_ON(is_realtime(tsk));
732 }
733
723 /* 734 /*
724 * If do_exit is called because this processes oopsed, it's possible 735 * If do_exit is called because this processes oopsed, it's possible
725 * that get_fs() was left as KERNEL_DS, so reset it to USER_DS before 736 * that get_fs() was left as KERNEL_DS, so reset it to USER_DS before