diff options
| author | Ingo Molnar <mingo@kernel.org> | 2017-10-10 11:30:59 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2017-10-10 11:30:59 +0200 |
| commit | 151aeab77738469ddbf0f9532e2fddd0d231aa2b (patch) | |
| tree | cb1320931d458aeecd1d504575c62ad554a3417a /kernel/fork.c | |
| parent | sched/fair: Update calc_group_*() comments (diff) | |
| parent | sched/core: Ensure load_balance() respects the active_mask (diff) | |
| download | linux-151aeab77738469ddbf0f9532e2fddd0d231aa2b.tar.gz linux-151aeab77738469ddbf0f9532e2fddd0d231aa2b.zip | |
Merge branch 'sched/urgent' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/fork.c')
| -rw-r--r-- | kernel/fork.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 10646182440f..e702cb9ffbd8 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -946,6 +946,24 @@ void mmput(struct mm_struct *mm) } EXPORT_SYMBOL_GPL(mmput); +#ifdef CONFIG_MMU +static void mmput_async_fn(struct work_struct *work) +{ + struct mm_struct *mm = container_of(work, struct mm_struct, + async_put_work); + + __mmput(mm); +} + +void mmput_async(struct mm_struct *mm) +{ + if (atomic_dec_and_test(&mm->mm_users)) { + INIT_WORK(&mm->async_put_work, mmput_async_fn); + schedule_work(&mm->async_put_work); + } +} +#endif + /** * set_mm_exe_file - change a reference to the mm's executable file * |
