[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/3] QIOChannelSocket: Fix zero-copy flush returning code
From: |
Leonardo Bras Soares Passos |
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 |
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
>
[PATCH v3 2/3] Add dirty-sync-missed-zero-copy migration stat, Leonardo Bras, 2022/07/04
[PATCH v3 3/3] migration/multifd: Warn user when zerocopy not working, Leonardo Bras, 2022/07/04