From: Leonardo Bras Soares Passos <leobras@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Juan Quintela" <quintela@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Eric Blake" <eblake@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [PATCH v3 1/3] QIOChannelSocket: Fix zero-copy flush returning code 1 when nothing sent
Date: Mon, 11 Jul 2022 16:29:52 -0300 [thread overview]
Message-ID: <CAJ6HWG7C9_dhtLD8UDMePgTfj97b63Wb5fCr=3k+eEE0DbQMKw@mail.gmail.com> (raw)
In-Reply-To: <YsdbnfbTnE/ZJvQt@xz-m1.local>
On Thu, Jul 7, 2022 at 7:18 PM Peter Xu <peterx@redhat.com> wrote:
>
> On Thu, Jul 07, 2022 at 06:14:17PM -0300, Leonardo Brás wrote:
> > Having 'if(queued == sent)' will cause us to falsely return '1' in two buggy
> > cases, while 'if queued == 0) will either skip early or go into 'infinite' loop.
>
> I'm not sure I strictly follow here..
>
Sorry, I was thinking of a different scenario.
> Imagine the case we do flush() twice without sending anything, then in the
> 1st flush we'll see queued>sent, we'll finish flush() until queued==sent.
> Then in the 2nd (continuous) flush() we'll see queued==sent immediately.
>
> IIUC with the current patch we'll return 1 which I think is wrong because
> fallback didn't happen, and if with the change to "if (queued==sent) return
> 0" it'll fix it?
Yes, you are correct.
It's a possible scenario to have a flush happen just after another
without any sending in between.
I will fix it as suggested.
Best regards,
Leo
>
> --
> Peter Xu
>
next prev parent reply other threads:[~2022-07-11 19:33 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 20:23 [PATCH v3 0/3] Zero copy improvements (QIOChannel + multifd) Leonardo Bras
2022-07-04 20:23 ` [PATCH v3 1/3] QIOChannelSocket: Fix zero-copy flush returning code 1 when nothing sent Leonardo Bras
2022-07-05 8:04 ` Daniel P. Berrangé
2022-07-05 15:15 ` Juan Quintela
2022-07-07 17:46 ` Peter Xu
2022-07-07 19:44 ` Leonardo Bras Soares Passos
2022-07-07 19:52 ` Peter Xu
2022-07-07 21:14 ` Leonardo Brás
2022-07-07 22:18 ` Peter Xu
2022-07-11 19:29 ` Leonardo Bras Soares Passos [this message]
2022-07-04 20:23 ` [PATCH v3 2/3] Add dirty-sync-missed-zero-copy migration stat Leonardo Bras
2022-07-05 4:14 ` Markus Armbruster
2022-07-05 8:05 ` Daniel P. Berrangé
2022-07-07 17:54 ` Peter Xu
2022-07-07 19:50 ` Leonardo Bras Soares Passos
2022-07-07 19:56 ` Peter Xu
2022-07-07 21:16 ` Leonardo Brás
2022-07-04 20:23 ` [PATCH v3 3/3] migration/multifd: Warn user when zerocopy not working Leonardo Bras
2022-07-05 8:05 ` Daniel P. Berrangé
2022-07-07 17:56 ` Peter Xu
2022-07-07 19:59 ` Leonardo Bras Soares Passos
2022-07-07 20:06 ` Peter Xu
2022-07-07 21:18 ` Leonardo Brás
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='CAJ6HWG7C9_dhtLD8UDMePgTfj97b63Wb5fCr=3k+eEE0DbQMKw@mail.gmail.com' \
--to=leobras@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@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 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).