diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2019-11-06 22:55:38 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-30 13:32:11 +0100 |
commit | 9425476fb17a29b9f1c564321ae4b80129534c57 (patch) | |
tree | fdfce91a61ee48d07b6506fcb43c67b37237be77 /kernel/fork.c | |
parent | 095444fad7e35dcd63d0c6b86461d024314e2051 (diff) | |
download | linux-stable-9425476fb17a29b9f1c564321ae4b80129534c57.tar.gz linux-stable-9425476fb17a29b9f1c564321ae4b80129534c57.tar.bz2 linux-stable-9425476fb17a29b9f1c564321ae4b80129534c57.zip |
exit/exec: Seperate mm_release()
commit 4610ba7ad877fafc0a25a30c6c82015304120426 upstream
mm_release() contains the futex exit handling. mm_release() is called from
do_exit()->exit_mm() and from exec()->exec_mm().
In the exit_mm() case PF_EXITING and the futex state is updated. In the
exec_mm() case these states are not touched.
As the futex exit code needs further protections against exit races, this
needs to be split into two functions.
Preparatory only, no functional change.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20191106224556.240518241@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index ee83f4ee5616..1982db8bebb3 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1217,7 +1217,7 @@ static int wait_for_vfork_done(struct task_struct *child, * restoring the old one. . . * Eric Biederman 10 January 1998 */ -void mm_release(struct task_struct *tsk, struct mm_struct *mm) +static void mm_release(struct task_struct *tsk, struct mm_struct *mm) { /* Get rid of any futexes when releasing the mm */ futex_mm_release(tsk); @@ -1254,6 +1254,16 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm) complete_vfork_done(tsk); } +void exit_mm_release(struct task_struct *tsk, struct mm_struct *mm) +{ + mm_release(tsk, mm); +} + +void exec_mm_release(struct task_struct *tsk, struct mm_struct *mm) +{ + mm_release(tsk, mm); +} + /* * Allocate a new mm structure and copy contents from the * mm structure of the passed in task structure. |