diff options
author | Steve Muckle <smuckle@codeaurora.org> | 2014-10-22 12:46:58 -0700 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:00:55 -0700 |
commit | 4edc997e12994f2b62bdfc1388cabc258654f990 (patch) | |
tree | 2706447fb548c26ccfff50a98573afb17be44c9b /kernel | |
parent | 98f89f00dc4fc76e67d707f895b1dd7166bc47b4 (diff) |
sched: take rq lock prior to saving idle task's mark_start
When the idle task is being re-initialized during hotplug its
mark_start value must be retained. The runqueue lock must be
held when reading this value though to serialize this with
other CPUs that could update the idle task's window-based
statistics.
CRs-Fixed: 743991
Change-Id: I1bca092d9ebc32a808cea2b9fe890cd24dc868cd
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 733ce45430b9..7ec7b5442f41 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6587,11 +6587,13 @@ void init_idle(struct task_struct *idle, int cpu) { struct rq *rq = cpu_rq(cpu); unsigned long flags; - u64 mark_start = orig_mark_start(idle); + u64 mark_start; raw_spin_lock_irqsave(&idle->pi_lock, flags); raw_spin_lock(&rq->lock); + mark_start = orig_mark_start(idle); + __sched_fork(0, idle); /* * Restore idle thread's original mark_start as we rely on it being |