Peter Xu <pet...@redhat.com> writes: > On Mon, Jul 22, 2024 at 02:59:11PM -0300, Fabiano Rosas wrote: >> All references to pages are being removed from the multifd worker >> threads in order to allow multifd to deal with different payload >> types. >> >> multifd_send_zero_page_detect() is called by all multifd migration >> paths that deal with pages and is the last spot where zero pages and >> normal page amounts are adjusted. Move the pages accounting into that >> function. > > True, but it's a bit hackish to update (especially, normal) page counters > in a zero page detect function.
Hm, that's the one place in the code that actually sets normal_num. Seems adequate to me. > I understand you want to move pages out of the thread function, that's > fair. How about put it in your new multifd_ram_fill_packet()? > That one is skipped when mapped-ram is in use. I could move it to nocomp_send_prepare() after the zero_page_detect. It seems we're moving towards changing nocomp -> ram at some point anyway. Would that be better? It would duplicate the call due to the compression code.