Skip to content

Commit f24f224

Browse files
committed
futex: Set task::futex_state to DEAD right after handling futex exit
Setting task::futex_state in do_exit() is rather arbitrarily placed for no reason. Move it into the futex code. Note, this is only done for the exit cleanup as the exec cleanup cannot set the state to FUTEX_STATE_DEAD because the task struct is still in active use. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Ingo Molnar <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 150d715 commit f24f224

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

kernel/exit.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,6 @@ void __noreturn do_exit(long code)
837837
* Make sure we are holding no locks:
838838
*/
839839
debug_check_no_locks_held();
840-
futex_exit_done(tsk);
841840

842841
if (tsk->io_context)
843842
exit_io_context(tsk);

kernel/futex.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3682,6 +3682,7 @@ void futex_exec_release(struct task_struct *tsk)
36823682
void futex_exit_release(struct task_struct *tsk)
36833683
{
36843684
futex_exec_release(tsk);
3685+
futex_exit_done(tsk);
36853686
}
36863687

36873688
long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,

0 commit comments

Comments
 (0)