On Thu, Feb 22, 2024 at 8:38 PM Hao Xiang <[email protected]> wrote: > > On Fri, Feb 16, 2024 at 9:08 PM Richard Henderson > <[email protected]> wrote: > > > > On 2/16/24 12:39, Hao Xiang wrote: > > > +void multifd_zero_page_check_recv(MultiFDRecvParams *p) > > > +{ > > > + for (int i = 0; i < p->zero_num; i++) { > > > + void *page = p->host + p->zero[i]; > > > + if (!buffer_is_zero(page, p->page_size)) { > > > + memset(page, 0, p->page_size); > > > + } > > > + } > > > +} > > > > You should not check the buffer is zero here, you should just zero it. > > I will fix it in the next version.
I tested with zero out all pages but the performance is bad compared to previously. In my test case, most pages are zero pages. I think what happened is that the destination host already has the pages being zero so performing a memcmp is much faster than memset on all zero pages. > > > > > > > r~
