[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 答复: [PATCH 5/6] migration/qemu-file.c: Don't ratelimit a shutdown fd
From: |
Dr. David Alan Gilbert |
Subject: |
Re: 答复: [PATCH 5/6] migration/qemu-file.c: Don't ratelimit a shutdown fd |
Date: |
Mon, 18 May 2020 12:55:34 +0100 |
User-agent: |
Mutt/1.13.4 (2020-02-15) |
* Zhanghailiang (address@hidden) wrote:
> > This causes the migration thread to hang if we failover during checkpoint. A
> > shutdown fd won't cause network traffic anyway.
> >
>
> I'm not quite sure if this modification can take side effect on normal
> migration process or not,
> There are several places calling it.
>
> Maybe Juan and Dave can help ;)
>
> > Signed-off-by: Lukas Straub <address@hidden>
> > ---
> > migration/qemu-file.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/migration/qemu-file.c b/migration/qemu-file.c index
> > 1c3a358a14..0748b5810f 100644
> > --- a/migration/qemu-file.c
> > +++ b/migration/qemu-file.c
> > @@ -660,7 +660,7 @@ int64_t qemu_ftell(QEMUFile *f) int
> > qemu_file_rate_limit(QEMUFile *f) {
> > if (f->shutdown) {
> > - return 1;
> > + return 0;
> > }
This looks wrong to me; I'd be curious to understand how it's hanging
for you.
'1' means 'stop what you're doing', 0 means carry on; carrying on with a
shutdown fd sounds wrong.
If we look at ram.c we have:
while ((ret = qemu_file_rate_limit(f)) == 0 ||
!QSIMPLEQ_EMPTY(&rs->src_page_requests)) {
int pages;
....
so if it returns '1', as it does at the moment it should cause it to
exit the ram_save_iterate loop - which is what we want if it's failing.
Thus I think you need to find the actual place it's stuck in this case -
I suspect it's repeatedly calling ram_save_iterate and then exiting it,
but if that's happening perhaps we're missing a qemu_file_get_error
check somewhere.
Dave
> > if (qemu_file_get_error(f)) {
> > return 1;
> > --
> > 2.20.1
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- 答复: [PATCH 1/6] migration/colo.c: Use event instead of semaphore, (continued)
[PATCH 6/6] migration/colo.c: Move colo_notify_compares_event to the right place, Lukas Straub, 2020/05/11
RE: [PATCH 6/6] migration/colo.c: Move colo_notify_compares_event to the right place, Zhanghailiang, 2020/05/14