diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-08-09 07:18:54 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2017-05-26 17:12:37 -0400 |
commit | 141fbbfcabf3b7686e6d3a6578b47b94805adb8e (patch) | |
tree | 538f3842641156d6b113f44bc7cd2c2005efde93 /kernel | |
parent | e186efe1e0878778f3874b92b102ac020d165275 (diff) |
Hook into kernel/exit.c to force exiting RT tasks into best-effort mode
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 89ea9c8a7305..c45f7f2e8b75 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -60,6 +60,8 @@ | |||
60 | #include <asm/pgtable.h> | 60 | #include <asm/pgtable.h> |
61 | #include <asm/mmu_context.h> | 61 | #include <asm/mmu_context.h> |
62 | 62 | ||
63 | #include <litmus/litmus.h> | ||
64 | |||
63 | extern void exit_od_table(struct task_struct *t); | 65 | extern void exit_od_table(struct task_struct *t); |
64 | 66 | ||
65 | static void __unhash_process(struct task_struct *p, bool group_dead) | 67 | static void __unhash_process(struct task_struct *p, bool group_dead) |
@@ -743,6 +745,15 @@ void __noreturn do_exit(long code) | |||
743 | if (unlikely(!tsk->pid)) | 745 | if (unlikely(!tsk->pid)) |
744 | panic("Attempted to kill the idle task!"); | 746 | panic("Attempted to kill the idle task!"); |
745 | 747 | ||
748 | if (unlikely(is_realtime(tsk))) { | ||
749 | /* We would like the task to be polite | ||
750 | * and transition out of RT mode first. | ||
751 | * Let's give it a little help. | ||
752 | */ | ||
753 | litmus_do_exit(tsk); | ||
754 | BUG_ON(is_realtime(tsk)); | ||
755 | } | ||
756 | |||
746 | /* | 757 | /* |
747 | * If do_exit is called because this processes oopsed, it's possible | 758 | * If do_exit is called because this processes oopsed, it's possible |
748 | * that get_fs() was left as KERNEL_DS, so reset it to USER_DS before | 759 | * that get_fs() was left as KERNEL_DS, so reset it to USER_DS before |