aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 76c0e9691fc0..e3f8f4f61c8e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2311,7 +2311,7 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state,
2311{ 2311{
2312 int cpu, orig_cpu, this_cpu, success = 0; 2312 int cpu, orig_cpu, this_cpu, success = 0;
2313 unsigned long flags; 2313 unsigned long flags;
2314 struct rq *rq; 2314 struct rq *rq, *orig_rq;
2315 2315
2316 if (!sched_feat(SYNC_WAKEUPS)) 2316 if (!sched_feat(SYNC_WAKEUPS))
2317 wake_flags &= ~WF_SYNC; 2317 wake_flags &= ~WF_SYNC;
@@ -2319,7 +2319,7 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state,
2319 this_cpu = get_cpu(); 2319 this_cpu = get_cpu();
2320 2320
2321 smp_wmb(); 2321 smp_wmb();
2322 rq = task_rq_lock(p, &flags); 2322 rq = orig_rq = task_rq_lock(p, &flags);
2323 update_rq_clock(rq); 2323 update_rq_clock(rq);
2324 if (!(p->state & state)) 2324 if (!(p->state & state))
2325 goto out; 2325 goto out;
@@ -2350,6 +2350,10 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state,
2350 set_task_cpu(p, cpu); 2350 set_task_cpu(p, cpu);
2351 2351
2352 rq = task_rq_lock(p, &flags); 2352 rq = task_rq_lock(p, &flags);
2353
2354 if (rq != orig_rq)
2355 update_rq_clock(rq);
2356
2353 WARN_ON(p->state != TASK_WAKING); 2357 WARN_ON(p->state != TASK_WAKING);
2354 cpu = task_cpu(p); 2358 cpu = task_cpu(p);
2355 2359