From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: Manish Mishra <manish.mishra@nutanix.com>,
qemu-devel@nongnu.org, leobras@redhat.com, farosas@suse.de
Subject: Re: [PATCH v2] QIOChannelSocket: Flush zerocopy socket error queue on ENOBUF failure for sendmsg
Date: Mon, 10 Mar 2025 19:48:16 +0000 [thread overview]
Message-ID: <Z89CALrwKnHdO4hx@redhat.com> (raw)
In-Reply-To: <Z885hS6QmGOZYj7N@x1.local>
On Mon, Mar 10, 2025 at 03:12:05PM -0400, Peter Xu wrote:
> On Sun, Mar 09, 2025 at 09:15:00PM -0400, Manish Mishra wrote:
> > We allocate extra metadata SKBs in case of a zerocopy send. This metadata
> > memory is accounted for in the OPTMEM limit. If there is any error while
> > sending zerocopy packets or if zerocopy is skipped, these metadata SKBs are
> > queued in the socket error queue. This error queue is freed when userspace
> > reads it.
> >
> > Usually, if there are continuous failures, we merge the metadata into a single
> > SKB and free another one. As a result, it never exceeds the OPTMEM limit.
> > However, if there is any out-of-order processing or intermittent zerocopy
> > failures, this error chain can grow significantly, exhausting the OPTMEM limit.
> > As a result, all new sendmsg requests fail to allocate any new SKB, leading to
> > an ENOBUF error. Depending on the amount of data queued before the flush
> > (i.e., large live migration iterations), even large OPTMEM limits are prone to
> > failure.
> >
> > To work around this, if we encounter an ENOBUF error with a zerocopy sendmsg,
> > we flush the error queue and retry once more.
> >
> > Additionally, this patch removes the dirty_sync_missed_zero_copy migration
> > stat. This stat is not used anywhere and does not seem useful. Removing it
> > simplifies the patch.
>
> IMHO it's still useful, it's just that if it's for debugging purpose, it's
> optional to expose it via QAPI. Then if without exposing it to upper
> layer, it can simplify the change this patch wanted to introduce. We can
> still keep it a tracepoint.
> > diff --git a/migration/multifd.c b/migration/multifd.c
> > index dfb5189f0e..ee6b2d3cba 100644
> > --- a/migration/multifd.c
> > +++ b/migration/multifd.c
> > @@ -607,9 +607,6 @@ static int multifd_zero_copy_flush(QIOChannel *c)
> > error_report_err(err);
> > return -1;
> > }
> > - if (ret == 1) {
> > - stat64_add(&mig_stats.dirty_sync_missed_zero_copy, 1);
> > - }
>
> If we want to remove this, we need to remove the variable in QAPI too.
>
> # @dirty-sync-missed-zero-copy: Number of times dirty RAM
> # synchronization could not avoid copying dirty pages. This is
> # between 0 and @dirty-sync-count * @multifd-channels. (since
> # 7.1)
>
> Personally I'd remove it directly, but others may not always agree... in
> this case, the safe approach is to mark it deprecate and update this in
> docs/about/deprecated.rst. Then you can leave it to us to finally remove
> this entry (or send another patch after two qemu releases).
Given this is in public API, the data needs to remain reported accurately
for the whole deprecation period. IOW, the patch to qiochannel needs to
preserve this data too.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2025-03-10 19:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 1:15 [PATCH v2] QIOChannelSocket: Flush zerocopy socket error queue on ENOBUF failure for sendmsg Manish Mishra
2025-03-10 19:12 ` Peter Xu
2025-03-10 19:48 ` Daniel P. Berrangé [this message]
2025-03-10 20:03 ` Peter Xu
2025-03-10 22:45 ` Manish
2025-03-11 15:22 ` Peter Xu
2025-03-11 15:30 ` Manish
2025-03-11 8:13 ` Daniel P. Berrangé
2025-03-11 15:20 ` Peter Xu
2025-03-11 15:33 ` Daniel P. Berrangé
2025-03-11 19:57 ` Peter Xu
2025-03-11 20:08 ` Daniel P. Berrangé
2025-03-11 21:37 ` Peter Xu
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=Z89CALrwKnHdO4hx@redhat.com \
--to=berrange@redhat.com \
--cc=farosas@suse.de \
--cc=leobras@redhat.com \
--cc=manish.mishra@nutanix.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.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).