* Juan Quintela (quint...@redhat.com) wrote: > > +/* > > + * Transmit the set of pages to be discarded after precopy to the target > > + * these are pages that: > > + * a) Have been previously transmitted but are now dirty again > > + * b) Pages that have never been transmitted, this ensures that > > + * any pages on the destination that have been mapped by background > > + * tasks get discarded (transparent huge pages is the specific > > concern) > > + * Hopefully this is pretty sparse > > + */ > > +int ram_postcopy_send_discard_bitmap(MigrationState *ms) > > +{ > > + int ret; > > + > > + rcu_read_lock(); > > + > > + /* This should be our last sync, the src is now paused */ > > + migration_bitmap_sync(); > > + > > + /* > > + * Update the sentmap to be sentmap = ~sentmap | dirty > > + */ > > + bitmap_complement(ms->sentmap, ms->sentmap, > > + last_ram_offset() >> TARGET_PAGE_BITS); > > + > > + bitmap_or(ms->sentmap, ms->sentmap, migration_bitmap, > > + last_ram_offset() >> TARGET_PAGE_BITS); > > This bitmaps are really big, I don't know how long would take to do this > operations here, but I think that we can avoid (at least) the > bitmap_complement. We can change the bitmap name to notsentbitmap, init > it to one and clear it each time that we sent a page, no?
Done, it's now 'unsentmap' - although I suspect the complement step is probably one of the simpler steps in the process, I'm not sure it's a vast saving. > We can also do the bitmap_or() at migration_sync_bitmap() time, at that > point, we shouldn't be on the critical path? Given that we're doing the bitmap_sync immediately before the OR, I don't understand that line; are you talking about a modified migration_bitmap_sync? Dave > > Later, Juan. -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK