From: Peter Xu <peterx@redhat.com>
To: Manish <manish.mishra@nutanix.com>
Cc: qemu-devel@nongnu.org, berrange@redhat.com, leobras@redhat.com,
farosas@suse.de
Subject: Re: [PATCH v3] QIOChannelSocket: Flush zerocopy socket error queue on sendmsg failure due to ENOBUF
Date: Fri, 21 Mar 2025 11:24:18 -0400 [thread overview]
Message-ID: <Z92EoucdEiQ43BNs@x1.local> (raw)
In-Reply-To: <06c86fe2-3a34-4d74-9ef1-81ac220ecefe@nutanix.com>
On Fri, Mar 21, 2025 at 11:33:31AM +0530, Manish wrote:
> Hi Daniel, Peter,
>
> Please let me know if this latest patch looks good?
>
>
> On 17/03/25 7:22 am, 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.
> >
> > V2:
> > 1. Removed the dirty_sync_missed_zero_copy migration stat.
> > 2. Made the call to qio_channel_socket_flush_internal() from
> > qio_channel_socket_writev() non-blocking.
> >
> > V3:
> > 1. Add the dirty_sync_missed_zero_copy migration stat again.
> >
> > Signed-off-by: Manish Mishra <manish.mishra@nutanix.com>
I have an old comment which could still apply here:
https://lore.kernel.org/all/Z885hS6QmGOZYj7N@x1.local/
That's on s/zero_copy_flush_pending/zerocopy_flush_once/.
But no need to repost only for that.. that's more or less a nitpick. It's
unfortunate we need to keep the ABI and the complexity even if the counter
almost means nothing solid..
The change overall looks good here.
Reviewed-by: Peter Xu <peterx@redhat.com>
Thanks,
--
Peter Xu
next prev parent reply other threads:[~2025-03-21 15:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 1:52 [PATCH v3] QIOChannelSocket: Flush zerocopy socket error queue on sendmsg failure due to ENOBUF Manish Mishra
2025-03-21 6:03 ` Manish
2025-03-21 15:24 ` Peter Xu [this message]
2025-03-21 15:45 ` Daniel P. Berrangé
2025-04-02 8:11 ` Manish
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=Z92EoucdEiQ43BNs@x1.local \
--to=peterx@redhat.com \
--cc=berrange@redhat.com \
--cc=farosas@suse.de \
--cc=leobras@redhat.com \
--cc=manish.mishra@nutanix.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 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.