aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/sched_credit2.c
diff options
context:
space:
mode:
authorGeorge Dunlap <george.dunlap@eu.citrix.com>2012-04-10 10:41:55 +0100
committerGeorge Dunlap <george.dunlap@eu.citrix.com>2012-04-10 10:41:55 +0100
commit7d302763ac7b0ecefb437ea45ee5b8d27a20d016 (patch)
tree7d61eabb8b9e724c3df5a00779ead0d2cfe1682c /xen/common/sched_credit2.c
parent4cee6a3812e9e81532f89b5be15d549faf49fffd (diff)
downloadxen-7d302763ac7b0ecefb437ea45ee5b8d27a20d016.tar.gz
xen-7d302763ac7b0ecefb437ea45ee5b8d27a20d016.tar.bz2
xen-7d302763ac7b0ecefb437ea45ee5b8d27a20d016.zip
xen, credit2: Put the per-cpu schedule lock back to the default lock when releasing cpu
This fixes a bug that happens when you remove cpus from a credit2 cpupool. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/sched_credit2.c')
-rw-r--r--xen/common/sched_credit2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 785303b259..471f6d5b07 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -1952,6 +1952,7 @@ csched_free_pdata(const struct scheduler *ops, void *pcpu, int cpu)
unsigned long flags;
struct csched_private *prv = CSCHED_PRIV(ops);
struct csched_runqueue_data *rqd;
+ struct schedule_data *sd = &per_cpu(schedule_data, cpu);
int rqi;
spin_lock_irqsave(&prv->lock, flags);
@@ -1979,6 +1980,11 @@ csched_free_pdata(const struct scheduler *ops, void *pcpu, int cpu)
deactivate_runqueue(prv, rqi);
}
+ /* Move spinlock to the original lock. */
+ ASSERT(sd->schedule_lock == &rqd->lock);
+ ASSERT(!spin_is_locked(&sd->_lock));
+ sd->schedule_lock = &sd->_lock;
+
spin_unlock(&rqd->lock);
cpumask_clear_cpu(cpu, &prv->initialized);