On 07/04/15 03:55, Waiman Long wrote:
This patch adds the necessary Xen specific code to allow Xen toThis basically looks the same as the version I wrote, except I think you
support the CPU halting and kicking operations needed by the queue
spinlock PV code.
broke it.
+static void xen_qlock_wait(u8 *byte, u8 val)My version had a barrier() here to ensure this. The documentation of
+{
+ int irq = __this_cpu_read(lock_kicker_irq);
+
+ /* If kicker interrupts not initialized yet, just spin */
+ if (irq == -1)
+ return;
+
+ /* clear pending */
+ xen_clear_irq_pending(irq);
+
+ /*
+ * We check the byte value after clearing pending IRQ to make sure
+ * that we won't miss a wakeup event because of the clearing.
READ_ONCE() suggests that it is not sufficient to meet this requirement
(and a READ_ONCE() here is not required anyway).