All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: "Peter Xu" <peterx@redhat.com>,
	"Mattias Nissler" <mnissler@rivosinc.com>,
	qemu-devel@nongnu.org, john.levon@nutanix.com,
	"Jagannathan Raman" <jag.raman@oracle.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"David Hildenbrand" <david@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Elena Ufimtseva" <elena.ufimtseva@oracle.com>,
	armbru@redhat.com
Subject: Re: [PATCH v2 1/4] softmmu: Support concurrent bounce buffers
Date: Fri, 01 Sep 2023 15:41:52 +0200	[thread overview]
Message-ID: <87edjixb6n.fsf@pond.sub.org> (raw)
In-Reply-To: <20230824133245.GA1412804@fedora> (Stefan Hajnoczi's message of "Thu, 24 Aug 2023 09:32:45 -0400")

Stefan Hajnoczi <stefanha@redhat.com> writes:

> On Wed, Aug 23, 2023 at 04:54:06PM -0400, Peter Xu wrote:
>> On Wed, Aug 23, 2023 at 10:08:08PM +0200, Mattias Nissler wrote:
>> > On Wed, Aug 23, 2023 at 7:35 PM Peter Xu <peterx@redhat.com> wrote:
>> > > On Wed, Aug 23, 2023 at 02:29:02AM -0700, Mattias Nissler wrote:
>> > > > diff --git a/softmmu/vl.c b/softmmu/vl.c
>> > > > index b0b96f67fa..dbe52f5ea1 100644
>> > > > --- a/softmmu/vl.c
>> > > > +++ b/softmmu/vl.c
>> > > > @@ -3469,6 +3469,12 @@ void qemu_init(int argc, char **argv)
>> > > >                  exit(1);
>> > > >  #endif
>> > > >                  break;
>> > > > +            case QEMU_OPTION_max_bounce_buffer_size:
>> > > > +                if (qemu_strtosz(optarg, NULL, &max_bounce_buffer_size) < 0) {
>> > > > +                    error_report("invalid -max-ounce-buffer-size value");
>> > > > +                    exit(1);
>> > > > +                }
>> > > > +                break;
>> > >
>> > > PS: I had a vague memory that we do not recommend adding more qemu cmdline
>> > > options, but I don't know enough on the plan to say anything real.
>> > 
>> > I am aware of that, and I'm really not happy with the command line
>> > option myself. Consider the command line flag a straw man I put in to
>> > see whether any reviewers have better ideas :)
>> > 
>> > More seriously, I actually did look around to see whether I can add
>> > the parameter to one of the existing option groupings somewhere, but
>> > neither do I have a suitable QOM object that I can attach the
>> > parameter to, nor did I find any global option groups that fits: this
>> > is not really memory configuration, and it's not really CPU
>> > configuration, it's more related to shared device model
>> > infrastructure... If you have a good idea for a home for this, I'm all
>> > ears.
>> 
>> No good & simple suggestion here, sorry.  We can keep the option there
>> until someone jumps in, then the better alternative could also come along.
>> 
>> After all I expect if we can choose a sensible enough default value, this
>> new option shouldn't be used by anyone for real.
>
> QEMU commits to stability in its external interfaces. Once the
> command-line option is added, it needs to be supported in the future or
> go through the deprecation process. I think we should agree on the
> command-line option now.
>
> Two ways to avoid the issue:
> 1. Drop the command-line option until someone needs it.

Avoiding unneeded configuration knobs is always good.

> 2. Make it an experimental option (with an "x-" prefix).

Fine if actual experiments are planned.

Also fine if it's a development or debugging aid.

> The closest to a proper solution that I found was adding it as a
> -machine property. What bothers me is that if QEMU supports
> multi-machine emulation in a single process some day, then the property
> doesn't make sense since it's global rather than specific to a machine.
>
> CCing Markus Armbruster for ideas.

I'm afraid I'm lacking context.  Glancing at the patch...

    ``-max-bounce-buffer-size size``
        Set the limit in bytes for DMA bounce buffer allocations.
    
        DMA bounce buffers are used when device models request memory-mapped access
        to memory regions that can't be directly mapped by the qemu process, so the
        memory must read or written to a temporary local buffer for the device
        model to work with. This is the case e.g. for I/O memory regions, and when
        running in multi-process mode without shared access to memory.
    
        Whether bounce buffering is necessary depends heavily on the device model
        implementation. Some devices use explicit DMA read and write operations
        which do not require bounce buffers. Some devices, notably storage, will
        retry a failed DMA map request after bounce buffer space becomes available
        again. Most other devices will bail when encountering map request failures,
        which will typically appear to the guest as a hardware error.
    
        Suitable bounce buffer size values depend on the workload and guest
        configuration. A few kilobytes up to a few megabytes are common sizes
        encountered in practice.

Sounds quite device-specific.  Why isn't this configured per device?



  reply	other threads:[~2023-09-01 13:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23  9:29 [PATCH v2 0/4] Support message-based DMA in vfio-user server Mattias Nissler
2023-08-23  9:29 ` [PATCH v2 1/4] softmmu: Support concurrent bounce buffers Mattias Nissler
2023-08-23 17:34   ` Peter Xu
2023-08-23 20:08     ` Mattias Nissler
2023-08-23 20:54       ` Peter Xu
2023-08-24  6:58         ` Mattias Nissler
2023-08-24 13:32         ` Stefan Hajnoczi
2023-09-01 13:41           ` Markus Armbruster [this message]
2023-09-05  7:38             ` Mattias Nissler
2023-09-05 13:45               ` Peter Xu
2023-09-07 12:37                 ` Mattias Nissler
2023-08-23  9:29 ` [PATCH v2 2/4] Update subprojects/libvfio-user Mattias Nissler
2023-08-23  9:29 ` [PATCH v2 3/4] vfio-user: Message-based DMA support Mattias Nissler
2023-08-23  9:29 ` [PATCH v2 4/4] vfio-user: Fix config space access byte order Mattias Nissler

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=87edjixb6n.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=david@redhat.com \
    --cc=elena.ufimtseva@oracle.com \
    --cc=jag.raman@oracle.com \
    --cc=john.levon@nutanix.com \
    --cc=mnissler@rivosinc.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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.