[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/2] xen/sched: fix locking in restore_vcpu_affinity()



On 23.07.19 14:08, Jan Beulich wrote:
On 23.07.2019 11:20, Juergen Gross wrote:
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -708,6 +708,8 @@ void restore_vcpu_affinity(struct domain *d)
            * set v->processor of each of their vCPUs to something that will
            * make sense for the scheduler of the cpupool in which they are in.
            */
+        lock = vcpu_schedule_lock_irq(v);
+
           cpumask_and(cpumask_scratch_cpu(cpu), v->cpu_hard_affinity,
                       cpupool_domain_cpumask(d));
           if ( cpumask_empty(cpumask_scratch_cpu(cpu)) )
@@ -731,6 +733,9 @@ void restore_vcpu_affinity(struct domain *d)
v->processor = cpumask_any(cpumask_scratch_cpu(cpu)); + spin_unlock_irq(lock);
+
+       /* v->processor might have changed, so reacquire the lock. */

Whoever commits this (perhaps me, later today) will want to replace
the hard tab here.

Oh, I'm sorry for that!

We really want checkpatch in Xen!


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.