Skip to contentSkip to conversation

futex: Move exit_pi_state() call to release_mm()

tip:core/urgent tip-bot for Thomas Gleixner 1 participant 1 message Oct 6, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw
Commit-ID:  322a2c100a8998158445599ea437fb556aa95b11
Gitweb:     http://git.kernel.org/tip/322a2c100a8998158445599ea437fb556aa95b11
Author:     Thomas Gleixner <[email protected]>
AuthorDate: Mon, 5 Oct 2009 18:18:03 +0200
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Tue, 6 Oct 2009 17:00:01 +0200

futex: Move exit_pi_state() call to release_mm()

exit_pi_state() is called from do_exit() but not from do_execve(). Move it to release_mm() so it gets called from do_execve() as well.

LKML-Reference: <new-submission>
Cc: [email protected]
Cc: Anirban Sinha <[email protected]>
Cc: Peter Zijlstra <[email protected]>

---
 kernel/exit.c |    2 --
 kernel/fork.c |    2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)
kernel/exit.c +0 -2
index ae5d866..bc2b1fd 100644
@@ -989,8 +989,6 @@ NORET_TYPE void do_exit(long code)
 	tsk->mempolicy = NULL;
 #endif
 #ifdef CONFIG_FUTEX
-	if (unlikely(!list_empty(&tsk->pi_state_list)))
-		exit_pi_state_list(tsk);
 	if (unlikely(current->pi_state_cache))
 		kfree(current->pi_state_cache);
 #endif
kernel/fork.c +2 -0
index 88ef51c..341965b 100644
@@ -553,6 +553,8 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm)
 		tsk->compat_robust_list = NULL;
 	}
 #endif
+	if (unlikely(!list_empty(&tsk->pi_state_list)))
+		exit_pi_state_list(tsk);
 #endif
 
 	/* Get rid of any cached register state */