summaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorCorey Minyard <cminyard@mvista.com>2017-11-02 12:19:15 -0400
committerCorey Minyard <cminyard@mvista.com>2017-11-02 12:19:15 -0400
commit6297fabd93f93182245383ba7de56bef829a796b (patch)
tree804f5d28ada61b402d56281c9a047308d26347f4 /kernel/fork.c
parentd7e17fe4f7a7d961cc4375c7d868bd353a039bc7 (diff)
parentece1996a21eeb344b49200e627c6660111009c10 (diff)
Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux into for-next
The IPMI SI driver was split into different pieces, merge the module tree to accountfor that. Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c22
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)
215 if (!s) 215 if (!s)
216 continue; 216 continue;
217 217
218#ifdef CONFIG_DEBUG_KMEMLEAK
219 /* Clear stale pointers from reused stack. */
220 memset(s->addr, 0, THREAD_SIZE);
221#endif
218 tsk->stack_vm_area = s; 222 tsk->stack_vm_area = s;
219 return s->addr; 223 return s->addr;
220 } 224 }
@@ -946,6 +950,24 @@ void mmput(struct mm_struct *mm)
946} 950}
947EXPORT_SYMBOL_GPL(mmput); 951EXPORT_SYMBOL_GPL(mmput);
948 952
953#ifdef CONFIG_MMU
954static void mmput_async_fn(struct work_struct *work)
955{
956 struct mm_struct *mm = container_of(work, struct mm_struct,
957 async_put_work);
958
959 __mmput(mm);
960}
961
962void mmput_async(struct mm_struct *mm)
963{
964 if (atomic_dec_and_test(&mm->mm_users)) {
965 INIT_WORK(&mm->async_put_work, mmput_async_fn);
966 schedule_work(&mm->async_put_work);
967 }
968}
969#endif
970
949/** 971/**
950 * set_mm_exe_file - change a reference to the mm's executable file 972 * set_mm_exe_file - change a reference to the mm's executable file
951 * 973 *