diff options
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index f6083561dfe0..ac62f43ee430 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/jiffies.h> | 40 | #include <linux/jiffies.h> |
41 | #include <linux/tracehook.h> | 41 | #include <linux/tracehook.h> |
42 | #include <linux/futex.h> | 42 | #include <linux/futex.h> |
43 | #include <linux/compat.h> | ||
43 | #include <linux/task_io_accounting_ops.h> | 44 | #include <linux/task_io_accounting_ops.h> |
44 | #include <linux/rcupdate.h> | 45 | #include <linux/rcupdate.h> |
45 | #include <linux/ptrace.h> | 46 | #include <linux/ptrace.h> |
@@ -79,6 +80,8 @@ DEFINE_PER_CPU(unsigned long, process_counts) = 0; | |||
79 | 80 | ||
80 | __cacheline_aligned DEFINE_RWLOCK(tasklist_lock); /* outer */ | 81 | __cacheline_aligned DEFINE_RWLOCK(tasklist_lock); /* outer */ |
81 | 82 | ||
83 | DEFINE_TRACE(sched_process_fork); | ||
84 | |||
82 | int nr_processes(void) | 85 | int nr_processes(void) |
83 | { | 86 | { |
84 | int cpu; | 87 | int cpu; |
@@ -519,6 +522,16 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm) | |||
519 | { | 522 | { |
520 | struct completion *vfork_done = tsk->vfork_done; | 523 | struct completion *vfork_done = tsk->vfork_done; |
521 | 524 | ||
525 | /* Get rid of any futexes when releasing the mm */ | ||
526 | #ifdef CONFIG_FUTEX | ||
527 | if (unlikely(tsk->robust_list)) | ||
528 | exit_robust_list(tsk); | ||
529 | #ifdef CONFIG_COMPAT | ||
530 | if (unlikely(tsk->compat_robust_list)) | ||
531 | compat_exit_robust_list(tsk); | ||
532 | #endif | ||
533 | #endif | ||
534 | |||
522 | /* Get rid of any cached register state */ | 535 | /* Get rid of any cached register state */ |
523 | deactivate_mm(tsk, mm); | 536 | deactivate_mm(tsk, mm); |
524 | 537 | ||