kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gregory Haskins <gregory.haskins@gmail.com>
To: alacrityvm-devel@lists.sourceforge.net
Cc: Ingo Molnar <mingo@elte.hu>,
	Gregory Haskins <ghaskins@novell.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: vbus design points: shm and shm-signals
Date: Fri, 21 Aug 2009 06:55:46 -0400	[thread overview]
Message-ID: <4A8E7D32.8040209@gmail.com> (raw)
In-Reply-To: <4A8B7F17.6050100@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4744 bytes --]

Gregory Haskins wrote:
> Ingo Molnar wrote:
>>
>> We all love faster code and better management interfaces and tons 
>> of your prior patches got accepted by Avi. This time you didnt even 
>> _try_ to improve virtio.
> 
> Im sorry, but you are mistaken:
> 
> http://lkml.indiana.edu/hypermail/linux/kernel/0904.2/02443.html
> 

BTW: One point that I forgot to point out in this most recent thread
that I am particularly proud of here is the design of the vbus
shared-memory model.  Despite some claims to the contrary; not only is
it possible to improve virtio with vbus (as evident by the patch
referenced above)...I specifically designed vbus with virtio
considerations in mind from the start!  In fact, the design is conducive
to accelerating a variety of other models as well.  Read on for details.

Vbus was designed it to be _agnostic_ to the shm algorithm in general.
This allows you to, of course, run ring algorithms (such as virtqueues,
or IOQs), but really any other designs as well, such as shared-tables, etc.

A guest driver sees the following interface:

struct vbus_device_proxy_ops {
	int (*open)(struct vbus_device_proxy *dev, int version, int flags);
	int (*close)(struct vbus_device_proxy *dev, int flags);
	int (*shm)(struct vbus_device_proxy *dev, int id, int prio,
		   void *ptr, size_t len,
		   struct shm_signal_desc *sigdesc, struct shm_signal **signal,
		   int flags);
	int (*call)(struct vbus_device_proxy *dev, u32 func,
		    void *data, size_t len, int flags);
	void (*release)(struct vbus_device_proxy *dev);
};

note the ops->shm() method.  This allows the driver to register some
arbitrary pointer (ptr, len) with the host, optionally embedding a
shm_signal_desc object in the memory.  If "sigdesc" is non-null, the
connector will allocate and return a fully formed shm_signal object in
**signal.

shm-signal (posted in patch 1/6, I believe) is a generalization of the
basic mechanism you need for emitting and catching events via any
shared-memory based design.  It includes interrupt/hypercall mitigation
support which is independent of the actual shm algorithm (e.g. ring,
table, etc).  This means that we can get the event mitigation code (e.g.
disable unecessary interrupts/hypercalls, prevent spurious re-calls,
etc) in once place (and, ideally, correct), and things like the ring
algorithm (or table design, etc) can focus on their value-add, instead
of re-inventing the mitigation code each time.

You can then build your higher-layer algorithms (rings, tables, etc) in
terms of the shm-signal library.  As a matter of fact, if you look at
the patch referenced above, it implements the virtqueue->kick() method
on top of shm-signal.  IOQs follow a similar pattern.  And the RT
enhancements will, for instance, be using a table design for the
scheduler/interrupt control.

In short, vbus is the result of my experience in dealing with issues
like IO in virt.  I thought long and hard about where the issues were
for high-performance, low-latency, software-to-software IO for a
wide-variety of applications and environments.  I then tried to
systematically solve those problems at various key points in the stack
to promote maximum flexibility and reuse of those enhancements.  So we
see things like this generalization of async event mitigation with the
shm/shm-signal design, low-latency "hypercalls", reusable backend models
(which support both a variety of virt, as well as physical system use), etc.

Part of this flexibility means that we do not want to rely on something
like PCI because it's not necessarily available/logical in all
platforms/environments.  So rather than force such environments to fit
into a PCI ABI, we start over again and offer an ABI specific to the
actual goals (high-performance, low-latency, software-to-software IO).

Yes, that means we will possibly take some lumps in the short-term
before these concepts and support for them are ubiquitous (like PCI, USB
are today).  But, like all things, you have to start somewhere.  The PCI
guys didn't try to make PCI look like ISA, and the USB guys didn't try
to make USB look like PCI.  It took a little while for support for such
notions to catch on, but eventually all relevant platforms supported
them.  I am going for the same thing here.  Sometimes, the existing
model just doesn't fit well and you have to re-evaluate.

I hope that this helps clarify some of the design of vbus and why I
believe it to be worth considering.  I will plan on taking this email as
the first entry on the wiki as a "design series" (or something like
that) and update it regularly with other aspects of the design.

Kind Regards,
-Greg






[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 267 bytes --]

  parent reply	other threads:[~2009-08-21 10:55 UTC|newest]

Thread overview: 119+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090814154125.26116.70709.stgit@dev.haskins.net>
     [not found] ` <20090814154308.26116.46980.stgit@dev.haskins.net>
2009-08-15 10:32   ` [PATCH v3 3/6] vbus: add a "vbus-proxy" bus model for vbus_driver objects Ingo Molnar
2009-08-15 19:15     ` Anthony Liguori
2009-08-16  7:16       ` Ingo Molnar
2009-08-17 13:54         ` Anthony Liguori
2009-08-17 14:23           ` Ingo Molnar
2009-08-17 14:14       ` Gregory Haskins
2009-08-17 14:58         ` Avi Kivity
2009-08-17 15:05           ` Ingo Molnar
2009-08-17 17:41         ` Michael S. Tsirkin
2009-08-17 20:17           ` Gregory Haskins
2009-08-18  8:46             ` Michael S. Tsirkin
2009-08-18 15:19               ` Gregory Haskins
2009-08-18 16:25                 ` Michael S. Tsirkin
2009-08-18 15:53               ` [Alacrityvm-devel] " Ira W. Snyder
2009-08-18 16:51                 ` Avi Kivity
2009-08-18 17:27                   ` Ira W. Snyder
2009-08-18 17:47                     ` Avi Kivity
2009-08-18 18:27                       ` Ira W. Snyder
2009-08-18 18:52                         ` Avi Kivity
2009-08-18 20:59                           ` Ira W. Snyder
2009-08-18 21:26                             ` Avi Kivity
2009-08-18 22:06                               ` Avi Kivity
2009-08-19  0:44                                 ` Ira W. Snyder
2009-08-19  5:26                                   ` Avi Kivity
2009-08-19  0:38                               ` Ira W. Snyder
2009-08-19  5:40                                 ` Avi Kivity
2009-08-19 15:28                                   ` Ira W. Snyder
2009-08-19 15:37                                     ` Avi Kivity
2009-08-19 16:29                                       ` Ira W. Snyder
2009-08-19 16:38                                         ` Avi Kivity
2009-08-19 21:05                                           ` Hollis Blanchard
2009-08-20  9:57                                             ` Stefan Hajnoczi
2009-08-20 10:08                                               ` Avi Kivity
2009-08-18 20:35                         ` Michael S. Tsirkin
2009-08-18 21:04                           ` Arnd Bergmann
2009-08-18 20:39                     ` Michael S. Tsirkin
2009-08-18 20:57                 ` Michael S. Tsirkin
2009-08-18 23:24                   ` Ira W. Snyder
2009-08-18  1:08         ` Anthony Liguori
2009-08-18  7:38           ` Avi Kivity
2009-08-18  8:54           ` Michael S. Tsirkin
2009-08-18 13:16           ` Gregory Haskins
2009-08-18 13:45             ` Avi Kivity
2009-08-18 15:51               ` Gregory Haskins
2009-08-18 16:14                 ` Ingo Molnar
2009-08-19  4:27                   ` Gregory Haskins
2009-08-19  5:22                     ` Avi Kivity
2009-08-19 13:27                       ` Gregory Haskins
2009-08-19 14:35                         ` Avi Kivity
2009-08-21 10:55                     ` Gregory Haskins [this message]
2009-08-24 19:02                       ` vbus design points: shm and shm-signals Anthony Liguori
2009-08-24 20:00                         ` Gregory Haskins
2009-08-24 21:28                           ` Gregory Haskins
2009-08-24 23:57                           ` Anthony Liguori
2009-08-25  0:10                             ` Anthony Liguori
2009-08-18 16:47                 ` [PATCH v3 3/6] vbus: add a "vbus-proxy" bus model for vbus_driver objects Avi Kivity
2009-08-18 16:51                 ` Michael S. Tsirkin
2009-08-19  5:36                   ` Gregory Haskins
2009-08-19  5:48                     ` Avi Kivity
2009-08-19  6:40                       ` Gregory Haskins
2009-08-19  7:13                         ` Avi Kivity
2009-08-19 11:40                           ` Gregory Haskins
2009-08-19 11:49                             ` Avi Kivity
2009-08-19 11:52                               ` Gregory Haskins
2009-08-19 14:33                     ` Michael S. Tsirkin
2009-08-20 12:12                     ` Michael S. Tsirkin
2009-08-16  8:30     ` Avi Kivity
2009-08-17 14:16       ` Gregory Haskins
2009-08-17 14:59         ` Avi Kivity
2009-08-17 15:09           ` Gregory Haskins
2009-08-17 15:14             ` Ingo Molnar
2009-08-17 19:35               ` Gregory Haskins
2009-08-17 15:18             ` Avi Kivity
2009-08-17 13:02     ` Gregory Haskins
2009-08-17 14:25       ` Ingo Molnar
2009-08-17 15:05         ` Gregory Haskins
2009-08-17 15:08           ` Ingo Molnar
2009-08-17 19:33             ` Gregory Haskins
2009-08-18  8:33               ` Avi Kivity
2009-08-18 14:46                 ` Gregory Haskins
2009-08-18 16:27                   ` Avi Kivity
2009-08-19  6:28                     ` Gregory Haskins
2009-08-19  7:11                       ` Avi Kivity
2009-08-19 18:23                         ` Nicholas A. Bellinger
2009-08-19 18:39                           ` Gregory Haskins
2009-08-19 19:19                             ` Nicholas A. Bellinger
2009-08-19 19:34                               ` Nicholas A. Bellinger
2009-08-19 20:12                           ` configfs/sysfs Avi Kivity
2009-08-19 20:48                             ` configfs/sysfs Ingo Molnar
2009-08-19 20:53                               ` configfs/sysfs Avi Kivity
2009-08-19 21:19                             ` configfs/sysfs Nicholas A. Bellinger
2009-08-19 22:15                             ` configfs/sysfs Gregory Haskins
2009-08-19 22:16                             ` configfs/sysfs Joel Becker
2009-08-19 23:48                               ` [Alacrityvm-devel] configfs/sysfs Alex Tsariounov
2009-08-19 23:54                               ` configfs/sysfs Nicholas A. Bellinger
2009-08-20  6:09                               ` configfs/sysfs Avi Kivity
2009-08-20 22:48                                 ` configfs/sysfs Joel Becker
2009-08-21  4:14                                   ` configfs/sysfs Avi Kivity
2009-08-19 18:26                         ` [PATCH v3 3/6] vbus: add a "vbus-proxy" bus model for vbus_driver objects Gregory Haskins
2009-08-19 20:37                           ` Avi Kivity
2009-08-19 20:53                             ` Ingo Molnar
2009-08-20 17:25                             ` Muli Ben-Yehuda
2009-08-20 20:58                             ` Caitlin Bestler
2009-08-18 18:20                   ` Arnd Bergmann
2009-08-18 19:08                     ` Avi Kivity
2009-08-19  5:36                     ` Gregory Haskins
2009-08-18  9:53               ` Michael S. Tsirkin
2009-08-18 10:00                 ` Avi Kivity
2009-08-18 10:09                   ` Michael S. Tsirkin
2009-08-18 10:13                     ` Avi Kivity
2009-08-18 10:28                       ` Michael S. Tsirkin
2009-08-18 10:45                         ` Avi Kivity
2009-08-18 11:07                           ` Michael S. Tsirkin
2009-08-18 11:15                             ` Avi Kivity
2009-08-18 11:49                               ` Michael S. Tsirkin
2009-08-18 11:54                                 ` Avi Kivity
2009-08-18 15:39                 ` Gregory Haskins
2009-08-18 16:39                   ` Michael S. Tsirkin
2009-08-17 15:13           ` Avi Kivity

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=4A8E7D32.8040209@gmail.com \
    --to=gregory.haskins@gmail.com \
    --cc=alacrityvm-devel@lists.sourceforge.net \
    --cc=ghaskins@novell.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).