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>
This commit is contained in:
Steve Muckle 2014-10-22 12:46:58 -07:00 committed by David Keitel
parent 98f89f00dc
commit 4edc997e12

View file

@ -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