diff options
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index a46a50d67002..6832c614c663 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -69,6 +69,10 @@ | |||
69 | #include <asm/pgtable.h> | 69 | #include <asm/pgtable.h> |
70 | #include <asm/mmu_context.h> | 70 | #include <asm/mmu_context.h> |
71 | 71 | ||
72 | #include <litmus/litmus.h> | ||
73 | |||
74 | extern void exit_od_table(struct task_struct *t); | ||
75 | |||
72 | static void __unhash_process(struct task_struct *p, bool group_dead) | 76 | static void __unhash_process(struct task_struct *p, bool group_dead) |
73 | { | 77 | { |
74 | nr_threads--; | 78 | nr_threads--; |
@@ -727,6 +731,14 @@ void __noreturn do_exit(long code) | |||
727 | if (unlikely(!tsk->pid)) | 731 | if (unlikely(!tsk->pid)) |
728 | panic("Attempted to kill the idle task!"); | 732 | panic("Attempted to kill the idle task!"); |
729 | 733 | ||
734 | if (unlikely(is_realtime(tsk))) { | ||
735 | /* We would like the task to be polite and transition out of | ||
736 | * RT mode first. | ||
737 | */ | ||
738 | litmus_do_exit(tsk); | ||
739 | BUG_ON(is_realtime(tsk); | ||
740 | } | ||
741 | |||
730 | /* | 742 | /* |
731 | * If do_exit is called because this processes oopsed, it's possible | 743 | * 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 | 744 | * that get_fs() was left as KERNEL_DS, so reset it to USER_DS before |
@@ -798,6 +810,8 @@ void __noreturn do_exit(long code) | |||
798 | tty_audit_exit(); | 810 | tty_audit_exit(); |
799 | audit_free(tsk); | 811 | audit_free(tsk); |
800 | 812 | ||
813 | exit_od_table(tsk); | ||
814 | |||
801 | tsk->exit_code = code; | 815 | tsk->exit_code = code; |
802 | taskstats_exit(tsk, group_dead); | 816 | taskstats_exit(tsk, group_dead); |
803 | 817 | ||