virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Amit Shah <amit.shah@redhat.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: virtualization@lists.linux-foundation.org
Subject: Re: [PATCH 18/31] virtio: console: Buffer data that comes from the host
Date: Thu, 14 Jan 2010 08:47:53 +0530	[thread overview]
Message-ID: <20100114031753.GG24002@amit-x200.redhat.com> (raw)
In-Reply-To: <201001140945.12345.rusty@rustcorp.com.au>

On (Thu) Jan 14 2010 [09:45:12], Rusty Russell wrote:
> On Wed, 13 Jan 2010 09:54:52 pm Amit Shah wrote:
> > On (Wed) Jan 13 2010 [21:43:32], Rusty Russell wrote:
> > > On Wed, 13 Jan 2010 04:41:48 pm Amit Shah wrote:
> > > > On (Mon) Jan 04 2010 [15:17:17], Amit Shah wrote:
> > > > > On (Mon) Jan 04 2010 [19:45:30], Rusty Russell wrote:
> > > > > > On Wed, 23 Dec 2009 01:04:28 am Amit Shah wrote:
> > > > > > > The console could be flooded with data from the host; handle this
> > > > > > > situation by buffering the data.
> > > > > > 
> > > > > > Is this still true?  If we only add_buf when we're ready, surely the host
> > > > > > can't flood us with one virtqueue per port?
> > > > > 
> > > > > I guess I meant something completely different. This message is
> > > > > definitely misleading and I'll re-word it.
> > > > > 
> > > > > You're right; we don't need the 'guest throttling' feature that was
> > > > > needed earlier.
> > > > 
> > > > BTW I meant this series doesn't have the guest throttling feature.
> > > > 
> > > > Rusty, did you just have this comment for the series? If yes, I'll just
> > > > re-send this patch with a fixed description.
> > > 
> > > I don't see why we ever allocate more than one incoming buffer though?
> > 
> > To prevent against a fast host app sending data to a slow guest
> > consumer.
> > 
> > Also, we use the in_vq for the buffering, so the number of buffers is
> > limited by the queue size that's declared by the host.
> 
> But if the guest only ever registers one input buffer at a time, we get the
> same effect.  And it means we use less memory.  And our code is simpler.

The number of buffers to be registered in the vq comes from the host
anyway; if the host wants to be able to use multiple buffers, we should
be able to use them.

Also, we lose out on the ability of the host to send us data when the
guest is slow to read.

(I also see this as a policy decision being made in the guest to limit
to one buffer at a time; the decision should be made by the host: if the
guest is started with a bigger vq by the host, the kernel is capable of
using it all...)

> Similar with output.

For output I've already switched to using one buffer per vq and spinning
till the host acks having received the buffer.

		Amit

  reply	other threads:[~2010-01-14  3:17 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-22 14:34 [PATCH 00/31] virtio: console: Fixes, multiple devices and generic ports Amit Shah
2009-12-22 14:34 ` [PATCH 01/31] virtio: console: comment cleanup Amit Shah
2009-12-22 14:34   ` [PATCH 02/31] virtio: console: statically initialize virtio_cons Amit Shah
2009-12-22 14:34     ` [PATCH 03/31] hvc_console: make the ops pointer const Amit Shah
     [not found]     ` <1261492481-19817-4-git-send-email-amit.shah@redhat.com>
2009-12-22 14:34       ` [PATCH 04/31] hvc_console: Remove __devinit annotation from hvc_alloc Amit Shah
     [not found]       ` <1261492481-19817-5-git-send-email-amit.shah@redhat.com>
2009-12-22 14:34         ` [PATCH 05/31] virtio: console: We support only one device at a time Amit Shah
2009-12-22 14:34           ` [PATCH 06/31] virtio: console: port encapsulation Amit Shah
2009-12-22 14:34             ` [PATCH 07/31] virtio: console: encapsulate buffer information in a struct Amit Shah
2009-12-22 14:34               ` [PATCH 08/31] virtio: console: ensure add_inbuf can work for multiple ports as well Amit Shah
2009-12-22 14:34                 ` [PATCH 09/31] virtio: console: introduce a get_inbuf helper to fetch bufs from in_vq Amit Shah
2009-12-22 14:34                   ` [PATCH 10/31] virtio: console: use vdev->priv to avoid accessing global var Amit Shah
2009-12-22 14:34                     ` [PATCH 11/31] virtio: console: don't assume a single console port Amit Shah
2009-12-22 14:34                       ` [PATCH 12/31] virtio: console: remove global var Amit Shah
2009-12-22 14:34                         ` [PATCH 13/31] virtio: console: struct ports for multiple ports per device Amit Shah
2009-12-22 14:34                           ` [PATCH 14/31] virtio: console: ensure console size is updated on hvc open Amit Shah
2009-12-22 14:34                             ` [PATCH 15/31] virtio: console: Separate out console-specific data into a separate struct Amit Shah
2009-12-22 14:34                               ` [PATCH 16/31] virtio: console: Separate out console init into a new function Amit Shah
2009-12-22 14:34                                 ` [PATCH 17/31] virtio: console: Separate out find_vqs operation into a different function Amit Shah
2009-12-22 14:34                                   ` [PATCH 18/31] virtio: console: Buffer data that comes from the host Amit Shah
2009-12-22 14:34                                     ` [PATCH 19/31] virtio: console: Introduce a send_buf function for a common path for sending data to host Amit Shah
2009-12-22 14:34                                       ` [PATCH 20/31] virtio: console: Introduce a 'header' for each buffer towards supporting multiport Amit Shah
2009-12-22 14:34                                         ` [PATCH 21/31] virtio: console: Add a new MULTIPORT feature, support for generic ports Amit Shah
2009-12-22 14:34                                           ` [PATCH 22/31] virtio: console: Prepare for writing to / reading from userspace buffers Amit Shah
2009-12-22 14:34                                             ` [PATCH 23/31] virtio: console: Associate each port with a char device Amit Shah
2009-12-22 14:34                                               ` [PATCH 24/31] virtio: console: Add file operations to ports for open/read/write/poll Amit Shah
2009-12-22 14:34                                                 ` [PATCH 25/31] virtio: console: Ensure only one process can have a port open at a time Amit Shah
2009-12-22 14:34                                                   ` [PATCH 26/31] virtio: console: Register with sysfs and create a 'name' attribute for ports Amit Shah
2009-12-22 14:34                                                     ` [PATCH 27/31] virtio: console: Add throttling support to prevent flooding ports Amit Shah
2009-12-22 14:34                                                       ` [PATCH 28/31] virtio: console: Add option to remove cached buffers on port close Amit Shah
2009-12-22 14:34                                                         ` [PATCH 29/31] virtio: console: Handle port hot-plug Amit Shah
2009-12-22 14:34                                                           ` [PATCH 30/31] virtio: console: Add ability to hot-unplug ports Amit Shah
2009-12-22 14:34                                                             ` [PATCH 31/31] virtio: console: Add debugfs files for each port to expose debug info Amit Shah
2010-01-04  9:15                                     ` [PATCH 18/31] virtio: console: Buffer data that comes from the host Rusty Russell
2010-01-04  9:47                                       ` Amit Shah
2010-01-13  6:11                                         ` Amit Shah
2010-01-13 11:13                                           ` Rusty Russell
2010-01-13 11:24                                             ` Amit Shah
2010-01-13 23:15                                               ` Rusty Russell
2010-01-14  3:17                                                 ` Amit Shah [this message]
2010-01-16 22:16                                                   ` Rusty Russell
2010-01-12  2:21       ` [PATCH 03/31] hvc_console: make the ops pointer const Benjamin Herrenschmidt
     [not found]       ` <1263262906.724.175.camel@pasglop>
2010-01-12 11:36         ` Rusty Russell
2009-12-23  6:39 ` [PATCH 00/31] virtio: console: Fixes, multiple devices and generic ports Rusty Russell
2009-12-23  6:44   ` Amit Shah

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=20100114031753.GG24002@amit-x200.redhat.com \
    --to=amit.shah@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --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 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).