aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2014-06-02 08:22:02 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2014-06-07 05:31:07 -0400
commit1f0829fdfeb0b62077ab8ceb02e9995c95733f96 (patch)
tree8f3313a45c893f658cf70ce12007fe563c856fe0
parent5243b6a42cf6a227221e7af140758e9eaafa56a8 (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 eb29f3be09d7..2f5b807f21ac 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);
@@ -727,6 +729,15 @@ void do_exit(long code)
727 if (unlikely(!tsk->pid)) 729 if (unlikely(!tsk->pid))
728 panic("Attempted to kill the idle task!"); 730 panic("Attempted to kill the idle task!");
729 731
732 if (unlikely(is_realtime(tsk))) {
733 /* We would like the task to be polite
734 * and transition out of RT mode first.
735 * Let's give it a little help.
736 */
737 litmus_do_exit(tsk);
738 BUG_ON(is_realtime(tsk));
739 }
740
730 /* 741 /*
731 * If do_exit is called because this processes oopsed, it's possible 742 * If do_exit is called because this processes oopsed, it's possible
732 * that get_fs() was left as KERNEL_DS, so reset it to USER_DS before 743 * that get_fs() was left as KERNEL_DS, so reset it to USER_DS before