Subject: Re: x86 instructions reordering
To: None <bouyer@antioche.lip6.fr>
From: Takayoshi Kochi <kochi@NetBSD.org>
List: port-xen
Date: 03/25/2005 10:42:26
Hi,

> So basically, the sender send an event only if the receiver isn't already busy.
> But sometimes, the receiver stops and isn't getting an event. The only way I
> can see this happen is if the read and writes to memory
> don't happen in the intended order. This problem only occurs if the
> reader and writer are running on different CPUs of the HT P4. I couldn't
> reproduce this if I force both virtual machine to run on the same CPU, while
> it locks up quickly if each virtual machine runs on a different virtual CPU.

Do you have any observation _where_ the sender or the reader locks up?

I imagine from the arguments, that the sender doesn't call send_event()
because it never sees (shared_memory->b == a) to be true.  At that point,
are you sure the receiver has finished all the events and written its 'b'
to shared_memory->b?

If the scheduling of the two virtual guest OSes are not equal, and
the sender has priority, the receiver might not have enough time to
handle all the events and keep busy all the time, which will fail to
signal to the sender that the receiver is idle.

---
Takayoshi Kochi