From: Rusty Russell <rusty@rustcorp.com.au>
To: Avi Kivity <avi@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself
Date: Fri, 7 May 2010 12:53:52 +0930 [thread overview]
Message-ID: <201005071253.53393.rusty@rustcorp.com.au> (raw)
In-Reply-To: <4BE29320.5090506@redhat.com>
On Thu, 6 May 2010 07:30:00 pm Avi Kivity wrote:
> On 05/05/2010 11:58 PM, Michael S. Tsirkin wrote:
> > + /* We publish the last-seen used index at the end of the available ring.
> > + * It is at the end for backwards compatibility. */
> > + vr->last_used_idx =&(vr)->avail->ring[num];
> > + /* Verify that last used index does not spill over the used ring. */
> > + BUG_ON((void *)vr->last_used_idx +
> > + sizeof *vr->last_used_idx> (void *)vr->used);
> > }
> >
>
> Shouldn't this be on its own cache line?
It's next to the available ring; because that's where the guest publishes
its data. That whole page is guest-write, host-read.
Putting it on a cacheline by itself would be a slight pessimization; the host
cpu would have to get the last_used_idx cacheline and the avail descriptor
cacheline every time. This way, they are sometimes the same cacheline.
Hope that clarifies,
Rusty.
WARNING: multiple messages have this Message-ID (diff)
From: Rusty Russell <rusty@rustcorp.com.au>
To: Avi Kivity <avi@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself
Date: Fri, 7 May 2010 12:53:52 +0930 [thread overview]
Message-ID: <201005071253.53393.rusty@rustcorp.com.au> (raw)
In-Reply-To: <4BE29320.5090506@redhat.com>
On Thu, 6 May 2010 07:30:00 pm Avi Kivity wrote:
> On 05/05/2010 11:58 PM, Michael S. Tsirkin wrote:
> > + /* We publish the last-seen used index at the end of the available ring.
> > + * It is at the end for backwards compatibility. */
> > + vr->last_used_idx =&(vr)->avail->ring[num];
> > + /* Verify that last used index does not spill over the used ring. */
> > + BUG_ON((void *)vr->last_used_idx +
> > + sizeof *vr->last_used_idx> (void *)vr->used);
> > }
> >
>
> Shouldn't this be on its own cache line?
It's next to the available ring; because that's where the guest publishes
its data. That whole page is guest-write, host-read.
Putting it on a cacheline by itself would be a slight pessimization; the host
cpu would have to get the last_used_idx cacheline and the avail descriptor
cacheline every time. This way, they are sometimes the same cacheline.
Hope that clarifies,
Rusty.
WARNING: multiple messages have this Message-ID (diff)
From: Rusty Russell <rusty@rustcorp.com.au>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself
Date: Fri, 7 May 2010 12:53:52 +0930 [thread overview]
Message-ID: <201005071253.53393.rusty@rustcorp.com.au> (raw)
In-Reply-To: <4BE29320.5090506@redhat.com>
On Thu, 6 May 2010 07:30:00 pm Avi Kivity wrote:
> On 05/05/2010 11:58 PM, Michael S. Tsirkin wrote:
> > + /* We publish the last-seen used index at the end of the available ring.
> > + * It is at the end for backwards compatibility. */
> > + vr->last_used_idx =&(vr)->avail->ring[num];
> > + /* Verify that last used index does not spill over the used ring. */
> > + BUG_ON((void *)vr->last_used_idx +
> > + sizeof *vr->last_used_idx> (void *)vr->used);
> > }
> >
>
> Shouldn't this be on its own cache line?
It's next to the available ring; because that's where the guest publishes
its data. That whole page is guest-write, host-read.
Putting it on a cacheline by itself would be a slight pessimization; the host
cpu would have to get the last_used_idx cacheline and the avail descriptor
cacheline every time. This way, they are sometimes the same cacheline.
Hope that clarifies,
Rusty.
next prev parent reply other threads:[~2010-05-07 3:24 UTC|newest]
Thread overview: 95+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-05 20:58 [PATCH RFC] virtio: put last seen used index into ring itself Michael S. Tsirkin
2010-05-05 20:58 ` [Qemu-devel] " Michael S. Tsirkin
2010-05-05 21:18 ` Dor Laor
2010-05-05 21:18 ` Dor Laor
2010-05-05 21:18 ` [Qemu-devel] " Dor Laor
2010-05-06 2:31 ` Rusty Russell
2010-05-06 2:31 ` Rusty Russell
2010-05-06 2:31 ` [Qemu-devel] " Rusty Russell
2010-05-06 6:19 ` Michael S. Tsirkin
2010-05-06 6:19 ` [Qemu-devel] " Michael S. Tsirkin
2010-05-07 3:33 ` Rusty Russell
2010-05-07 3:33 ` [Qemu-devel] " Rusty Russell
2010-05-07 3:33 ` Rusty Russell
2010-05-09 21:06 ` Michael S. Tsirkin
2010-05-09 21:06 ` Michael S. Tsirkin
2010-05-09 21:06 ` [Qemu-devel] " Michael S. Tsirkin
2010-05-06 6:19 ` Michael S. Tsirkin
2010-05-06 10:00 ` [Qemu-devel] " Avi Kivity
2010-05-06 10:00 ` Avi Kivity
2010-05-06 10:00 ` Avi Kivity
2010-05-07 3:23 ` Rusty Russell [this message]
2010-05-07 3:23 ` Rusty Russell
2010-05-07 3:23 ` Rusty Russell
2010-05-11 19:27 ` Avi Kivity
2010-05-11 19:27 ` Avi Kivity
2010-05-11 19:27 ` Avi Kivity
2010-05-11 19:52 ` Michael S. Tsirkin
2010-05-11 19:52 ` Michael S. Tsirkin
2010-05-11 19:52 ` Michael S. Tsirkin
2010-05-19 7:39 ` Rusty Russell
2010-05-19 7:39 ` Rusty Russell
2010-05-19 7:39 ` Rusty Russell
2010-05-19 8:06 ` Avi Kivity
2010-05-19 8:06 ` Avi Kivity
2010-05-19 22:33 ` Michael S. Tsirkin
2010-05-19 22:33 ` Michael S. Tsirkin
2010-05-19 22:33 ` Michael S. Tsirkin
2010-05-20 6:04 ` Avi Kivity
2010-05-20 6:04 ` Avi Kivity
2010-05-20 6:04 ` Avi Kivity
2010-05-20 5:01 ` Rusty Russell
2010-05-20 5:01 ` Rusty Russell
2010-05-20 5:01 ` Rusty Russell
2010-05-20 5:08 ` Rusty Russell
2010-05-20 5:08 ` Rusty Russell
2010-05-20 5:08 ` Rusty Russell
2010-05-23 15:31 ` Michael S. Tsirkin
2010-05-23 15:31 ` Michael S. Tsirkin
2010-05-23 15:31 ` Michael S. Tsirkin
2010-05-23 15:41 ` Avi Kivity
2010-05-23 15:41 ` Avi Kivity
2010-05-23 15:41 ` Avi Kivity
2010-05-23 15:51 ` Michael S. Tsirkin
2010-05-23 15:51 ` Michael S. Tsirkin
2010-05-23 15:51 ` Michael S. Tsirkin
2010-05-23 16:03 ` Avi Kivity
2010-05-23 16:03 ` Avi Kivity
2010-05-23 16:03 ` Avi Kivity
2010-05-23 16:30 ` Michael S. Tsirkin
2010-05-23 16:30 ` Michael S. Tsirkin
2010-05-23 16:30 ` Michael S. Tsirkin
2010-05-24 6:37 ` Avi Kivity
2010-05-24 6:37 ` Avi Kivity
2010-05-24 6:37 ` Avi Kivity
2010-05-24 8:05 ` Michael S. Tsirkin
2010-05-24 8:05 ` Michael S. Tsirkin
2010-05-24 8:05 ` Michael S. Tsirkin
2010-05-24 11:00 ` Avi Kivity
2010-05-24 11:00 ` Avi Kivity
2010-05-24 11:00 ` Avi Kivity
2010-05-23 17:28 ` Michael S. Tsirkin
2010-05-23 17:28 ` Michael S. Tsirkin
2010-05-23 17:28 ` Michael S. Tsirkin
2010-05-23 15:56 ` Michael S. Tsirkin
2010-05-23 15:56 ` Michael S. Tsirkin
2010-05-23 15:56 ` Michael S. Tsirkin
2010-05-20 7:00 ` Avi Kivity
2010-05-20 7:00 ` Avi Kivity
2010-05-20 7:00 ` Avi Kivity
2010-05-20 14:34 ` Rusty Russell
2010-05-20 14:34 ` Rusty Russell
2010-05-20 15:46 ` Avi Kivity
2010-05-20 15:46 ` Avi Kivity
2010-05-20 15:46 ` Avi Kivity
2010-05-20 14:34 ` Rusty Russell
2010-05-20 10:04 ` Michael S. Tsirkin
2010-05-20 10:04 ` Michael S. Tsirkin
2010-05-20 10:04 ` Michael S. Tsirkin
2010-05-07 3:23 ` Rusty Russell
2010-05-11 18:46 ` Ryan Harper
2010-05-11 18:46 ` Ryan Harper
2010-05-11 18:46 ` [Qemu-devel] " Ryan Harper
2010-05-11 19:48 ` Michael S. Tsirkin
2010-05-11 19:48 ` Michael S. Tsirkin
2010-05-11 19:48 ` [Qemu-devel] " Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201005071253.53393.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.