aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 490495a39c7e..2ce28f165e31 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -268,7 +268,7 @@ static inline int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
268 get_file(file); 268 get_file(file);
269 if (tmp->vm_flags & VM_DENYWRITE) 269 if (tmp->vm_flags & VM_DENYWRITE)
270 atomic_dec(&inode->i_writecount); 270 atomic_dec(&inode->i_writecount);
271 271
272 /* insert tmp into the share list, just after mpnt */ 272 /* insert tmp into the share list, just after mpnt */
273 spin_lock(&file->f_mapping->i_mmap_lock); 273 spin_lock(&file->f_mapping->i_mmap_lock);
274 tmp->vm_truncate_count = mpnt->vm_truncate_count; 274 tmp->vm_truncate_count = mpnt->vm_truncate_count;
@@ -331,7 +331,7 @@ static inline void mm_free_pgd(struct mm_struct * mm)
331#define mm_free_pgd(mm) 331#define mm_free_pgd(mm)
332#endif /* CONFIG_MMU */ 332#endif /* CONFIG_MMU */
333 333
334 __cacheline_aligned_in_smp DEFINE_SPINLOCK(mmlist_lock); 334__cacheline_aligned_in_smp DEFINE_SPINLOCK(mmlist_lock);
335 335
336#define allocate_mm() (kmem_cache_alloc(mm_cachep, GFP_KERNEL)) 336#define allocate_mm() (kmem_cache_alloc(mm_cachep, GFP_KERNEL))
337#define free_mm(mm) (kmem_cache_free(mm_cachep, (mm))) 337#define free_mm(mm) (kmem_cache_free(mm_cachep, (mm)))
@@ -738,8 +738,8 @@ static struct files_struct *dup_fd(struct files_struct *oldf, int *errorp)
738 /* compute the remainder to be cleared */ 738 /* compute the remainder to be cleared */
739 size = (new_fdt->max_fds - open_files) * sizeof(struct file *); 739 size = (new_fdt->max_fds - open_files) * sizeof(struct file *);
740 740
741 /* This is long word aligned thus could use a optimized version */ 741 /* This is long word aligned thus could use a optimized version */
742 memset(new_fds, 0, size); 742 memset(new_fds, 0, size);
743 743
744 if (new_fdt->max_fds > open_files) { 744 if (new_fdt->max_fds > open_files) {
745 int left = (new_fdt->max_fds-open_files)/8; 745 int left = (new_fdt->max_fds-open_files)/8;
@@ -942,6 +942,7 @@ static inline void copy_flags(unsigned long clone_flags, struct task_struct *p)
942 if (!(clone_flags & CLONE_PTRACE)) 942 if (!(clone_flags & CLONE_PTRACE))
943 p->ptrace = 0; 943 p->ptrace = 0;
944 p->flags = new_flags; 944 p->flags = new_flags;
945 clear_freeze_flag(p);
945} 946}
946 947
947asmlinkage long sys_set_tid_address(int __user *tidptr) 948asmlinkage long sys_set_tid_address(int __user *tidptr)
@@ -1058,6 +1059,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1058 p->utime = cputime_zero; 1059 p->utime = cputime_zero;
1059 p->stime = cputime_zero; 1060 p->stime = cputime_zero;
1060 p->gtime = cputime_zero; 1061 p->gtime = cputime_zero;
1062 p->utimescaled = cputime_zero;
1063 p->stimescaled = cputime_zero;
1061 1064
1062#ifdef CONFIG_TASK_XACCT 1065#ifdef CONFIG_TASK_XACCT
1063 p->rchar = 0; /* I/O counter: bytes read */ 1066 p->rchar = 0; /* I/O counter: bytes read */
@@ -1068,12 +1071,12 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1068 task_io_accounting_init(p); 1071 task_io_accounting_init(p);
1069 acct_clear_integrals(p); 1072 acct_clear_integrals(p);
1070 1073
1071 p->it_virt_expires = cputime_zero; 1074 p->it_virt_expires = cputime_zero;
1072 p->it_prof_expires = cputime_zero; 1075 p->it_prof_expires = cputime_zero;
1073 p->it_sched_expires = 0; 1076 p->it_sched_expires = 0;
1074 INIT_LIST_HEAD(&p->cpu_timers[0]); 1077 INIT_LIST_HEAD(&p->cpu_timers[0]);
1075 INIT_LIST_HEAD(&p->cpu_timers[1]); 1078 INIT_LIST_HEAD(&p->cpu_timers[1]);
1076 INIT_LIST_HEAD(&p->cpu_timers[2]); 1079 INIT_LIST_HEAD(&p->cpu_timers[2]);
1077 1080
1078 p->lock_depth = -1; /* -1 = no lock */ 1081 p->lock_depth = -1; /* -1 = no lock */
1079 do_posix_clock_monotonic_gettime(&p->start_time); 1082 do_posix_clock_monotonic_gettime(&p->start_time);
@@ -1083,7 +1086,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1083 p->security = NULL; 1086 p->security = NULL;
1084#endif 1087#endif
1085 p->io_context = NULL; 1088 p->io_context = NULL;
1086 p->io_wait = NULL;
1087 p->audit_context = NULL; 1089 p->audit_context = NULL;
1088 cpuset_fork(p); 1090 cpuset_fork(p);
1089#ifdef CONFIG_NUMA 1091#ifdef CONFIG_NUMA
@@ -1239,7 +1241,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1239 * A fatal signal pending means that current will exit, so the new 1241 * A fatal signal pending means that current will exit, so the new
1240 * thread can't slip out of an OOM kill (or normal SIGKILL). 1242 * thread can't slip out of an OOM kill (or normal SIGKILL).
1241 */ 1243 */
1242 recalc_sigpending(); 1244 recalc_sigpending();
1243 if (signal_pending(current)) { 1245 if (signal_pending(current)) {
1244 spin_unlock(&current->sighand->siglock); 1246 spin_unlock(&current->sighand->siglock);
1245 write_unlock_irq(&tasklist_lock); 1247 write_unlock_irq(&tasklist_lock);