summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/fork.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 88a2712c7273..bf522f2f33ca 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1215,11 +1215,13 @@ long do_fork(unsigned long clone_flags,
set_tsk_thread_flag(p, TIF_SIGPENDING);
}
- if (!(clone_flags & CLONE_STOPPED))
- wake_up_new_task(p, clone_flags);
- else
- p->state = TASK_STOPPED;
- ++total_forks;
+ if (likely(!(clone_flags & CLONE_IDLETASK))) {
+ if (!(clone_flags & CLONE_STOPPED))
+ wake_up_new_task(p, clone_flags);
+ else
+ p->state = TASK_STOPPED;
+ ++total_forks;
+ }
if (unlikely (trace)) {
current->ptrace_message = pid;