Hi On Thu, Feb 26, 2026 at 5:02 PM David Hildenbrand <[email protected]> wrote: > > On 2/26/26 14:59, [email protected] wrote: > > From: Marc-André Lureau <[email protected]> > > > > Replace the source-level replay wrappers with a new > > replay_by_populated_state() helper that iterates the section at > > min-granularity, calls is_populated() for each chunk, and aggregates > > consecutive chunks of the same state before invoking the callback. > > > > This moves the iteration logic from individual sources into the manager, > > preparing for multi-source aggregation where the manager must combine > > state from multiple sources anyway. > > > > The replay_populated/replay_discarded vtable entries in > > RamDiscardSourceClass are no longer called but remain in the interface > > for now; they will be removed in follow-up commits along with the > > now-dead source implementations. > > > > Signed-off-by: Marc-André Lureau <[email protected]> > > --- > > Isn't it significantly more expensive for large guests to possibly > iterate in 4k granularity?
It's a bit hard to say. How likely is it to have a very large RamDiscardManager with a min-granularity of 4k? > > The nice thing about the old implementation was that we could just scan > a bitmap, that is ideally in 2M granularity. We can still iterate with 2M granularity after this patch. However, it may be less effective than iterating using find_next_bit(). Whether this is noticeable remains to be seen. Note: this change was a suggestion from Peter in v1, as discussed in https://patchew.org/QEMU/[email protected]/[email protected]/#[email protected]
