diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-02-22 12:24:26 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-22 12:41:48 -0500 |
commit | 695884fb8acd9857e0e7120ccb2150e30f4b8fef (patch) | |
tree | 49aa424c1a021ce432e9fa5ea29d37a23e4e30cc /kernel/fork.c | |
parent | 5df91509d324d44cfb11e55d9cb02fe18b53b045 (diff) | |
parent | 04bea68b2f0eeebb089ecc67b618795925268b4a (diff) |
Merge branch 'devicetree/for-x86' of git://git.secretlab.ca/git/linux-2.6 into x86/platform
Reason: x86 devicetree support for ce4100 depends on those device tree
changes scheduled for .39.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 3b159c5991b7..25e429152ddc 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -66,6 +66,7 @@ | |||
66 | #include <linux/posix-timers.h> | 66 | #include <linux/posix-timers.h> |
67 | #include <linux/user-return-notifier.h> | 67 | #include <linux/user-return-notifier.h> |
68 | #include <linux/oom.h> | 68 | #include <linux/oom.h> |
69 | #include <linux/khugepaged.h> | ||
69 | 70 | ||
70 | #include <asm/pgtable.h> | 71 | #include <asm/pgtable.h> |
71 | #include <asm/pgalloc.h> | 72 | #include <asm/pgalloc.h> |
@@ -169,6 +170,7 @@ EXPORT_SYMBOL(free_task); | |||
169 | static inline void free_signal_struct(struct signal_struct *sig) | 170 | static inline void free_signal_struct(struct signal_struct *sig) |
170 | { | 171 | { |
171 | taskstats_tgid_free(sig); | 172 | taskstats_tgid_free(sig); |
173 | sched_autogroup_exit(sig); | ||
172 | kmem_cache_free(signal_cachep, sig); | 174 | kmem_cache_free(signal_cachep, sig); |
173 | } | 175 | } |
174 | 176 | ||
@@ -273,6 +275,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig) | |||
273 | 275 | ||
274 | setup_thread_stack(tsk, orig); | 276 | setup_thread_stack(tsk, orig); |
275 | clear_user_return_notifier(tsk); | 277 | clear_user_return_notifier(tsk); |
278 | clear_tsk_need_resched(tsk); | ||
276 | stackend = end_of_stack(tsk); | 279 | stackend = end_of_stack(tsk); |
277 | *stackend = STACK_END_MAGIC; /* for overflow detection */ | 280 | *stackend = STACK_END_MAGIC; /* for overflow detection */ |
278 | 281 | ||
@@ -328,6 +331,9 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) | |||
328 | retval = ksm_fork(mm, oldmm); | 331 | retval = ksm_fork(mm, oldmm); |
329 | if (retval) | 332 | if (retval) |
330 | goto out; | 333 | goto out; |
334 | retval = khugepaged_fork(mm, oldmm); | ||
335 | if (retval) | ||
336 | goto out; | ||
331 | 337 | ||
332 | prev = NULL; | 338 | prev = NULL; |
333 | for (mpnt = oldmm->mmap; mpnt; mpnt = mpnt->vm_next) { | 339 | for (mpnt = oldmm->mmap; mpnt; mpnt = mpnt->vm_next) { |
@@ -527,6 +533,9 @@ void __mmdrop(struct mm_struct *mm) | |||
527 | mm_free_pgd(mm); | 533 | mm_free_pgd(mm); |
528 | destroy_context(mm); | 534 | destroy_context(mm); |
529 | mmu_notifier_mm_destroy(mm); | 535 | mmu_notifier_mm_destroy(mm); |
536 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
537 | VM_BUG_ON(mm->pmd_huge_pte); | ||
538 | #endif | ||
530 | free_mm(mm); | 539 | free_mm(mm); |
531 | } | 540 | } |
532 | EXPORT_SYMBOL_GPL(__mmdrop); | 541 | EXPORT_SYMBOL_GPL(__mmdrop); |
@@ -541,6 +550,7 @@ void mmput(struct mm_struct *mm) | |||
541 | if (atomic_dec_and_test(&mm->mm_users)) { | 550 | if (atomic_dec_and_test(&mm->mm_users)) { |
542 | exit_aio(mm); | 551 | exit_aio(mm); |
543 | ksm_exit(mm); | 552 | ksm_exit(mm); |
553 | khugepaged_exit(mm); /* must run before exit_mmap */ | ||
544 | exit_mmap(mm); | 554 | exit_mmap(mm); |
545 | set_mm_exe_file(mm, NULL); | 555 | set_mm_exe_file(mm, NULL); |
546 | if (!list_empty(&mm->mmlist)) { | 556 | if (!list_empty(&mm->mmlist)) { |
@@ -667,6 +677,10 @@ struct mm_struct *dup_mm(struct task_struct *tsk) | |||
667 | mm->token_priority = 0; | 677 | mm->token_priority = 0; |
668 | mm->last_interval = 0; | 678 | mm->last_interval = 0; |
669 | 679 | ||
680 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
681 | mm->pmd_huge_pte = NULL; | ||
682 | #endif | ||
683 | |||
670 | if (!mm_init(mm, tsk)) | 684 | if (!mm_init(mm, tsk)) |
671 | goto fail_nomem; | 685 | goto fail_nomem; |
672 | 686 | ||
@@ -904,9 +918,11 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | |||
904 | posix_cpu_timers_init_group(sig); | 918 | posix_cpu_timers_init_group(sig); |
905 | 919 | ||
906 | tty_audit_fork(sig); | 920 | tty_audit_fork(sig); |
921 | sched_autogroup_fork(sig); | ||
907 | 922 | ||
908 | sig->oom_adj = current->signal->oom_adj; | 923 | sig->oom_adj = current->signal->oom_adj; |
909 | sig->oom_score_adj = current->signal->oom_score_adj; | 924 | sig->oom_score_adj = current->signal->oom_score_adj; |
925 | sig->oom_score_adj_min = current->signal->oom_score_adj_min; | ||
910 | 926 | ||
911 | mutex_init(&sig->cred_guard_mutex); | 927 | mutex_init(&sig->cred_guard_mutex); |
912 | 928 | ||
@@ -1282,7 +1298,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1282 | attach_pid(p, PIDTYPE_SID, task_session(current)); | 1298 | attach_pid(p, PIDTYPE_SID, task_session(current)); |
1283 | list_add_tail(&p->sibling, &p->real_parent->children); | 1299 | list_add_tail(&p->sibling, &p->real_parent->children); |
1284 | list_add_tail_rcu(&p->tasks, &init_task.tasks); | 1300 | list_add_tail_rcu(&p->tasks, &init_task.tasks); |
1285 | __get_cpu_var(process_counts)++; | 1301 | __this_cpu_inc(process_counts); |
1286 | } | 1302 | } |
1287 | attach_pid(p, PIDTYPE_PID, pid); | 1303 | attach_pid(p, PIDTYPE_PID, pid); |
1288 | nr_threads++; | 1304 | nr_threads++; |
@@ -1407,23 +1423,6 @@ long do_fork(unsigned long clone_flags, | |||
1407 | } | 1423 | } |
1408 | 1424 | ||
1409 | /* | 1425 | /* |
1410 | * We hope to recycle these flags after 2.6.26 | ||
1411 | */ | ||
1412 | if (unlikely(clone_flags & CLONE_STOPPED)) { | ||
1413 | static int __read_mostly count = 100; | ||
1414 | |||
1415 | if (count > 0 && printk_ratelimit()) { | ||
1416 | char comm[TASK_COMM_LEN]; | ||
1417 | |||
1418 | count--; | ||
1419 | printk(KERN_INFO "fork(): process `%s' used deprecated " | ||
1420 | "clone flags 0x%lx\n", | ||
1421 | get_task_comm(comm, current), | ||
1422 | clone_flags & CLONE_STOPPED); | ||
1423 | } | ||
1424 | } | ||
1425 | |||
1426 | /* | ||
1427 | * When called from kernel_thread, don't do user tracing stuff. | 1426 | * When called from kernel_thread, don't do user tracing stuff. |
1428 | */ | 1427 | */ |
1429 | if (likely(user_mode(regs))) | 1428 | if (likely(user_mode(regs))) |
@@ -1461,16 +1460,7 @@ long do_fork(unsigned long clone_flags, | |||
1461 | */ | 1460 | */ |
1462 | p->flags &= ~PF_STARTING; | 1461 | p->flags &= ~PF_STARTING; |
1463 | 1462 | ||
1464 | if (unlikely(clone_flags & CLONE_STOPPED)) { | 1463 | wake_up_new_task(p, clone_flags); |
1465 | /* | ||
1466 | * We'll start up with an immediate SIGSTOP. | ||
1467 | */ | ||
1468 | sigaddset(&p->pending.signal, SIGSTOP); | ||
1469 | set_tsk_thread_flag(p, TIF_SIGPENDING); | ||
1470 | __set_task_state(p, TASK_STOPPED); | ||
1471 | } else { | ||
1472 | wake_up_new_task(p, clone_flags); | ||
1473 | } | ||
1474 | 1464 | ||
1475 | tracehook_report_clone_complete(trace, regs, | 1465 | tracehook_report_clone_complete(trace, regs, |
1476 | clone_flags, nr, p); | 1466 | clone_flags, nr, p); |