Displaying 7 results from an estimated 7 matches for "__pv_queue_unlock".
2014 Jun 16
4
[PATCH 10/11] qspinlock: Paravirt support
...> + struct pv_node *pn;
> +
> + pn = pv_decode_tail(atomic_read(&lock->val));
> +
> + while (pn->head == INVALID_HEAD)
> + cpu_relax();
> +
> + if (WARN_ON_ONCE(pn->head == NO_HEAD))
> + return;
> +
> + pv_kick(pn->head);
> +}
> +
> +void __pv_queue_unlock(struct qspinlock *lock)
> +{
> + int val = atomic_read(&lock->val);
> +
> + native_queue_unlock(lock);
> +
> + if (val& _Q_LOCKED_SLOW)
> + ___pv_kick_head(lock);
> +}
> +
Again a race can happen here between the reading and writing of the lock
value. I can...
2014 Jun 16
4
[PATCH 10/11] qspinlock: Paravirt support
...> + struct pv_node *pn;
> +
> + pn = pv_decode_tail(atomic_read(&lock->val));
> +
> + while (pn->head == INVALID_HEAD)
> + cpu_relax();
> +
> + if (WARN_ON_ONCE(pn->head == NO_HEAD))
> + return;
> +
> + pv_kick(pn->head);
> +}
> +
> +void __pv_queue_unlock(struct qspinlock *lock)
> +{
> + int val = atomic_read(&lock->val);
> +
> + native_queue_unlock(lock);
> +
> + if (val& _Q_LOCKED_SLOW)
> + ___pv_kick_head(lock);
> +}
> +
Again a race can happen here between the reading and writing of the lock
value. I can...
2014 Jun 15
0
[PATCH 11/11] qspinlock, kvm: Add paravirt support
...}
}
}
+#else /* QUEUE_SPINLOCK */
+
+#include <asm-generic/qspinlock.h>
+
+PV_CALLEE_SAVE_REGS_THUNK(__pv_init_node);
+PV_CALLEE_SAVE_REGS_THUNK(__pv_link_and_wait_node);
+PV_CALLEE_SAVE_REGS_THUNK(__pv_kick_node);
+
+PV_CALLEE_SAVE_REGS_THUNK(__pv_wait_head);
+PV_CALLEE_SAVE_REGS_THUNK(__pv_queue_unlock);
+
+void kvm_wait(int *ptr, int val)
+{
+ unsigned long flags;
+
+ if (in_nmi())
+ return;
+
+ /*
+ * Make sure an interrupt handler can't upset things in a
+ * partially setup state.
+ */
+ local_irq_save(flags);
+
+ /*
+ * check again make sure it didn't become free while
+ * we we...
2014 Jun 15
0
[PATCH 10/11] qspinlock: Paravirt support
...IG_PARAVIRT_SPINLOCKS
+struct mcs_spinlock;
+
+extern void __pv_init_node(struct mcs_spinlock *node);
+extern void __pv_link_and_wait_node(u32 old, struct mcs_spinlock *node);
+extern void __pv_kick_node(struct mcs_spinlock *node);
+
+extern void __pv_wait_head(struct qspinlock *lock);
+extern void __pv_queue_unlock(struct qspinlock *lock);
+#endif
+
/*
* Initializier
*/
Index: linux-2.6/kernel/locking/qspinlock.c
===================================================================
--- linux-2.6.orig/kernel/locking/qspinlock.c
+++ linux-2.6/kernel/locking/qspinlock.c
@@ -56,13 +56,33 @@
#include "m...
2014 Jun 18
0
[PATCH 10/11] qspinlock: Paravirt support
Il 17/06/2014 00:08, Waiman Long ha scritto:
>> +void __pv_queue_unlock(struct qspinlock *lock)
>> +{
>> + int val = atomic_read(&lock->val);
>> +
>> + native_queue_unlock(lock);
>> +
>> + if (val & _Q_LOCKED_SLOW)
>> + ___pv_kick_head(lock);
>> +}
>> +
>
> Again a race can happen here between the...
2014 Jun 15
28
[PATCH 00/11] qspinlock with paravirt support
Since Waiman seems incapable of doing simple things; here's my take on the
paravirt crap.
The first few patches are taken from Waiman's latest series, but the virt
support is completely new. Its primary aim is to not mess up the native code.
I've not stress tested it, but the virt and paravirt (kvm) cases boot on simple
smp guests. I've not done Xen, but the patch should be
2014 Jun 15
28
[PATCH 00/11] qspinlock with paravirt support
Since Waiman seems incapable of doing simple things; here's my take on the
paravirt crap.
The first few patches are taken from Waiman's latest series, but the virt
support is completely new. Its primary aim is to not mess up the native code.
I've not stress tested it, but the virt and paravirt (kvm) cases boot on simple
smp guests. I've not done Xen, but the patch should be