[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: |
Peter Xu |
Subject: |
Re: [PATCH v3 1/3] QIOChannelSocket: Fix zero-copy flush returning code 1 when nothing sent |
Date: |
Thu, 7 Jul 2022 18:18:05 -0400 |
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..
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?
--
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