From 899cf6fc2feed3c06d4184406a089dc24de9f6da Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Mon, 25 Jul 2011 11:43:58 -0400 Subject: fixup: P-FP migration code Don't double-lock --- litmus/sched_pfp.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/litmus/sched_pfp.c b/litmus/sched_pfp.c index 7f9a49d9d373..20a7085e8710 100644 --- a/litmus/sched_pfp.c +++ b/litmus/sched_pfp.c @@ -1162,19 +1162,15 @@ static void pfp_migrate_to(int target_cpu) from = task_pfp(t); to = remote_pfp(target_cpu); - if (from < to) { - raw_spin_lock(&from->slock); - raw_spin_lock(&to->slock); - } else { - raw_spin_lock(&to->slock); - raw_spin_lock(&from->slock); - } + raw_spin_lock(&from->slock); /* switch partitions */ tsk_rt(t)->task_params.cpu = target_cpu; raw_spin_unlock(&from->slock); + raw_spin_lock(&to->slock); + requeue(t, to); if (fp_preemption_needed(&to->ready_queue, to->scheduled)) preempt(to); -- cgit v1.2.2