Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178029
b: refs/heads/master
c: 06b83b5
h: refs/heads/master
i:
  178027: ee6bb71
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Dec 16, 2009
1 parent 944b211 commit 7e52232
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e4f4288842ee12747e10c354d72be7d424c0b627
refs/heads/master: 06b83b5fbea273672822b6ee93e16781046553ec
18 changes: 9 additions & 9 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2540,14 +2540,6 @@ static void __sched_fork(struct task_struct *p)
#ifdef CONFIG_PREEMPT_NOTIFIERS
INIT_HLIST_HEAD(&p->preempt_notifiers);
#endif

/*
* We mark the process as running here, but have not actually
* inserted it onto the runqueue yet. This guarantees that
* nobody will actually run it, and a signal or other external
* event cannot wake it up and insert it on the runqueue either.
*/
p->state = TASK_RUNNING;
}

/*
Expand All @@ -2558,6 +2550,12 @@ void sched_fork(struct task_struct *p, int clone_flags)
int cpu = get_cpu();

__sched_fork(p);
/*
* We mark the process as waking here. This guarantees that
* nobody will actually run it, and a signal or other external
* event cannot wake it up and insert it on the runqueue either.
*/
p->state = TASK_WAKING;

/*
* Revert to default priority/policy on fork if requested.
Expand Down Expand Up @@ -2626,7 +2624,8 @@ void wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
struct rq *rq;

rq = task_rq_lock(p, &flags);
BUG_ON(p->state != TASK_RUNNING);
BUG_ON(p->state != TASK_WAKING);
p->state = TASK_RUNNING;
update_rq_clock(rq);
activate_task(rq, p, 0);
trace_sched_wakeup_new(rq, p, 1);
Expand Down Expand Up @@ -6984,6 +6983,7 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu)
raw_spin_lock_irqsave(&rq->lock, flags);

__sched_fork(idle);
idle->state = TASK_RUNNING;
idle->se.exec_start = sched_clock();

cpumask_copy(&idle->cpus_allowed, cpumask_of(cpu));
Expand Down

0 comments on commit 7e52232

Please sign in to comment.