The reason for percpu instead of global, was to avoid locking. We canDoesn't initial affinity (which is what we expect here since irqbalance
have a global variable (last_cpu) without locking, but value of
last_cpu wont be consistent, without locks. Moreover, since
irq_affinity is also used in the calculation of cpu to bind, having a
percpu or global wouldn't really matter, as the result (selected_cpu)
is more likely to be random (because different irqs can have different
affinity). What do you guys suggest.
has not run yet) typically cover all guest VCPUs?
If you are trying to protect affinity then it may well change after you
I think we would still require spin_lock(). spin_lock is for irq_desc.
drop the lock.
In fact, don't you have a race here? If we offline a VCPU we will (by
way of cpu_disable_common()->fixup_irqs()) update affinity to reflect
that a CPU is gone and there is a chance that xen_rebind_evtchn_to_cpu()
will happen after that.
So, contrary to what I said earlier ;-) not only do you need the lock,
but you should hold it across xen_rebind_evtchn_to_cpu() call. Does this
make sense?