diff options
| author | Dave Airlie <airlied@redhat.com> | 2017-11-02 12:40:41 +1000 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2017-11-02 12:40:41 +1000 |
| commit | 7a88cbd8d65d622c00bd76ba4ae1d893b292c91c (patch) | |
| tree | 826df7ac42ca13c33828d0142046186b91df686b /kernel/fork.c | |
| parent | 0a4334c9e5405f836c46375c6e279cfdda7da6b5 (diff) | |
| parent | 0b07194bb55ed836c2cc7c22e866b87a14681984 (diff) | |
Backmerge tag 'v4.14-rc7' into drm-next
Linux 4.14-rc7
Requested by Ben Skeggs for nouveau to avoid major conflicts,
and things were getting a bit conflicty already, esp around amdgpu
reverts.
Diffstat (limited to 'kernel/fork.c')
| -rw-r--r-- | kernel/fork.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 10646182440f..07cc743698d3 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -215,6 +215,10 @@ static unsigned long *alloc_thread_stack_node(struct task_struct *tsk, int node) if (!s) continue; +#ifdef CONFIG_DEBUG_KMEMLEAK + /* Clear stale pointers from reused stack. */ + memset(s->addr, 0, THREAD_SIZE); +#endif tsk->stack_vm_area = s; return s->addr; } @@ -946,6 +950,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 * |
