[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 21/23] multifd: Zero pages transmission
|
From: |
Dr. David Alan Gilbert |
|
Subject: |
Re: [PATCH v4 21/23] multifd: Zero pages transmission |
|
Date: |
Thu, 27 Jan 2022 15:13:04 +0000 |
|
User-agent: |
Mutt/2.1.5 (2021-12-30) |
* Juan Quintela (quintela@redhat.com) wrote:
> "Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
> > * Juan Quintela (quintela@redhat.com) wrote:
> >> This implements the zero page dection and handling.
> >>
> >> Signed-off-by: Juan Quintela <quintela@redhat.com>
> >>
> >> ---
> >>
> >> Add comment for offset (dave)
> >> }
> >> }
> >>
> >> + for (int i = 0; i < p->zero_num; i++) {
> >> + memset(p->host + p->zero[i], 0, qemu_target_page_size());
> >> + }
> >> +
> >
> > On the existing code, it tries to avoid doing the memset if the target
> > page size matches; that avoids allocating the zero pages on the
> > destination host; should we try and do the same here?
> >
> > Dave
>
> Hi Dave
>
> That only happens on postcopy.
> With precopy we have to do the memset, because we can have:
>
> write non zero to page 50
> migrate page 50
> write zeros to page 50
> Another migration pass
> If we don't write here, we have garbage on the page.
>
> Or I am missing something?
You're missing the call to buffer_is_zero:
void ram_handle_compressed(void *host, uint8_t ch, uint64_t size)
{
if (ch != 0 || !buffer_is_zero(host, size)) {
memset(host, ch, size);
}
}
so it checks the buffer to see if it was non-zero before doing the
memset.
Dave
> Later, Juan.
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
- [PATCH v4 18/23] migration: Make ram_save_target_page() a pointer, (continued)
- [PATCH v4 18/23] migration: Make ram_save_target_page() a pointer, Juan Quintela, 2022/01/11
- [PATCH v4 17/23] multifd: Rename pages_used to normal_pages, Juan Quintela, 2022/01/11
- [PATCH v4 13/23] multifd: Unfold "used" variable by its value, Juan Quintela, 2022/01/11
- [PATCH v4 23/23] migration: Export ram_release_page(), Juan Quintela, 2022/01/11
- [PATCH v4 21/23] multifd: Zero pages transmission, Juan Quintela, 2022/01/11
[PATCH v4 20/23] multifd: Support for zero pages transmission, Juan Quintela, 2022/01/11