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

Re: [Xen-devel] [PATCH v15 09/15] pvqspinlock: Implement simple paravirt support for the qspinlock



On Thu, Apr 09, 2015 at 05:41:44PM -0400, Waiman Long wrote:
> >>+__visible void __pv_queue_spin_unlock(struct qspinlock *lock)
> >>+{
> >>+   struct __qspinlock *l = (void *)lock;
> >>+   struct pv_node *node;
> >>+
> >>+   if (likely(cmpxchg(&l->locked, _Q_LOCKED_VAL, 0) == _Q_LOCKED_VAL))
> >>+           return;
> >>+
> >>+   /*
> >>+    * The queue head has been halted. Need to locate it and wake it up.
> >>+    */
> >>+   node = pv_hash_find(lock);
> >>+   smp_store_release(&l->locked, 0);
> >Ah yes, clever that.
> >
> >>+   /*
> >>+    * At this point the memory pointed at by lock can be freed/reused,
> >>+    * however we can still use the PV node to kick the CPU.
> >>+    */
> >>+   if (READ_ONCE(node->state) == vcpu_halted)
> >>+           pv_kick(node->cpu);
> >>+}
> >>+PV_CALLEE_SAVE_REGS_THUNK(__pv_queue_spin_unlock);
> >However I feel the PV_CALLEE_SAVE_REGS_THUNK thing belongs in the x86
> >code.
> 
> That is why I originally put my version of the qspinlock_paravirt.h header
> file under arch/x86/include/asm. Maybe we should move it back there. Putting
> the thunk in arch/x86/kernel/kvm.c didn't work when you consider that the
> Xen code also need that.

Well the function is 'generic' and belong here I think. Its just the
PV_CALLEE_SAVE_REGS_THUNK thing that arch specific. Should have live in
arch/x86/kernel/paravirt-spinlocks.c instead?

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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