In the meantime I adjusted the code but it does the clearing under the
iothread lock, which should not be what we want ... I'll have a look.

Thanks; if it takes more changes than expected we can still start from simple,
IMHO, by taking bql and timely yield it.

At the meantime, I found two things in ram_init_bitmaps() that I'm not sure we
need them of not:

   1. Do we need WITH_RCU_READ_LOCK_GUARD() if with both bql and ramlist lock?
      (small question)

Good question, I'm not sure if we need it.


   2. Do we need migration_bitmap_sync_precopy() even if dirty bmap is all 1's?
      (bigger question)

IIRC, the bitmap sync will fetch the proper dirty bitmap from KVM and set the proper bits in the clear_bitmap. So once we call migration_clear_memory_region_dirty_bitmap_range() etc. later we will actually clear dirty bits.

Without that, migration_clear_memory_region_dirty_bitmap_range() is a nop and we might migrate stuff unnecessarily twice as dirty bits are not cleared:

I certainly need that, otherwise the migration_clear_memory_region_dirty_bitmap_range() is a nop and it all won't work as you proposed.

--
Thanks,

David / dhildenb


Reply via email to