[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself |
Date: |
Sun, 23 May 2010 18:56:05 +0300 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
On Thu, May 20, 2010 at 02:38:16PM +0930, Rusty Russell wrote:
> On Thu, 20 May 2010 02:31:50 pm Rusty Russell wrote:
> > On Wed, 19 May 2010 05:36:42 pm Avi Kivity wrote:
> > > > Note that this is a exclusive->shared->exclusive bounce only, too.
> > > >
> > >
> > > A bounce is a bounce.
> >
> > I tried to measure this to show that you were wrong, but I was only able
> > to show that you're right. How annoying. Test code below.
>
> This time for sure!
The share option does not work on some
boxes unless I apply the following:
essentially, this adds mb() after each write
and before read. It seems to make sense to
me: we must update our counter before we
wanit for another side.
diff --git a/cachebounce.c b/cachebounce.c
index 0387027..ebe5a37 100644
--- a/cachebounce.c
+++ b/cachebounce.c
@@ -77,6 +77,7 @@ int main(int argc, char *argv[])
count++;
counter->cacheline1 = count;
count++;
+ __sync_synchronize();
}
break;
case UNSHARE:
@@ -86,6 +87,7 @@ int main(int argc, char *argv[])
count++;
counter->cacheline2 = count;
count++;
+ __sync_synchronize();
}
break;
case LOCKSHARE:
@@ -98,6 +100,7 @@ int main(int argc, char *argv[])
break;
case LOCKUNSHARE:
while (count < MAX_BOUNCES) {
+ __sync_synchronize();
/* Spin waiting for other side to change it. */
while (counter->cacheline1 != count);
__sync_val_compare_and_swap(&counter->cacheline2, count, count+1);
@@ -115,6 +118,7 @@ int main(int argc, char *argv[])
count++;
counter->cacheline1 = count;
count++;
+ __sync_synchronize();
}
break;
case UNSHARE:
@@ -124,6 +128,7 @@ int main(int argc, char *argv[])
count++;
counter->cacheline1 = count;
count++;
+ __sync_synchronize();
}
break;
case LOCKSHARE:
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, (continued)
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Rusty Russell, 2010/05/20
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Michael S. Tsirkin, 2010/05/23
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Avi Kivity, 2010/05/23
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Michael S. Tsirkin, 2010/05/23
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Avi Kivity, 2010/05/23
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Michael S. Tsirkin, 2010/05/23
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Avi Kivity, 2010/05/24
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Michael S. Tsirkin, 2010/05/24
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Avi Kivity, 2010/05/24
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Michael S. Tsirkin, 2010/05/23
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself,
Michael S. Tsirkin <=
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Avi Kivity, 2010/05/20
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Rusty Russell, 2010/05/20
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Avi Kivity, 2010/05/20
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Michael S. Tsirkin, 2010/05/20
[Qemu-devel] Re: [PATCH RFC] virtio: put last seen used index into ring itself, Ryan Harper, 2010/05/11