From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: netdev@vger.kernel.org
Subject: Re: thoughts stac/clac and get user for vhost
Date: Wed, 26 Dec 2018 10:06:59 -0500 [thread overview]
Message-ID: <20181226100341-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <a0306f51-269c-73b0-f229-2dbf33ef182c@redhat.com>
On Wed, Dec 26, 2018 at 12:03:50PM +0800, Jason Wang wrote:
>
> On 2018/12/26 上午12:41, Michael S. Tsirkin wrote:
> > Hi!
> > I was just wondering: packed ring batches things naturally.
> > E.g.
> >
> > user_access_begin
> > check descriptor valid
> > smp_rmb
> > copy descriptor
> > user_access_end
>
>
> But without speculation on the descriptor (which may only work for in-order
> or even a violation of spec). Only one two access of a single descriptor
> could be batched. For split ring, we can batch more since we know how many
> descriptors is pending. (avail_idx - last_avail_idx).
>
> Anything I miss?
>
> Thanks
>
just check more descriptors in a loop:
user_access_begin
for (i = 0; i < 16; ++i) {
if (!descriptor valid)
break;
smp_rmb
copy descriptor
}
user_access_end
you don't really need to know how many there are
ahead of the time as you still copy them 1 by one.
> >
> > So packed layout should show the gain with this approach.
> > That could be motivation enough to finally enable vhost packed ring
> > support.
> >
> > Thoughts?
> >
next prev parent reply other threads:[~2018-12-26 15:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-25 16:41 thoughts stac/clac and get user for vhost Michael S. Tsirkin
2018-12-26 4:03 ` Jason Wang
2018-12-26 15:06 ` Michael S. Tsirkin [this message]
2018-12-27 9:55 ` Jason Wang
2018-12-30 18:40 ` Michael S. Tsirkin
2019-01-02 3:25 ` Jason Wang
2019-01-04 21:25 ` Michael S. Tsirkin
2019-01-07 4:26 ` Jason Wang
2019-01-07 5:42 ` Michael S. Tsirkin
2019-01-07 6:54 ` Jason Wang
2019-01-07 14:45 ` Michael S. Tsirkin
2019-01-08 10:09 ` Jason Wang
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=20181226100341-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=jasowang@redhat.com \
--cc=netdev@vger.kernel.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.