[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC 10/15] migration: Move static var in ram_block_from_strea
From: |
Peter Xu |
Subject: |
Re: [PATCH RFC 10/15] migration: Move static var in ram_block_from_stream() into global |
Date: |
Tue, 8 Feb 2022 11:51:27 +0800 |
On Thu, Feb 03, 2022 at 05:48:31PM +0000, Dr. David Alan Gilbert wrote:
> * Peter Xu (peterx@redhat.com) wrote:
> > Static variable is very unfriendly to threading of ram_block_from_stream().
> > Move it into MigrationIncomingState.
> >
> > Make the incoming state pointer to be passed over to
> > ram_block_from_stream() on
> > both caller sites.
> >
> > Signed-off-by: Peter Xu <peterx@redhat.com>
>
> OK, but I'm not sure if I noticed where you changed this to be per
> channel later?
It's done in the last patch where it'll start to pass over "channel" index into
ram_block_from_stream():
static inline RAMBlock *ram_block_from_stream(MigrationIncomingState *mis,
QEMUFile *f, int flags,
int channel)
{
RAMBlock *block = mis->last_recv_block[channel];
...
}
I could have moved it into the new PostcopyTmpPage structure, but it'll be a
bit weird because precopy also uses this to cache the block info, hence I made
it an array.
>
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Thanks,
--
Peter Xu