On Tue, 12/09 17:44, Stefan Hajnoczi wrote: > On Mon, Dec 01, 2014 at 03:30:13PM -0500, John Snow wrote: > > From: Fam Zheng <f...@redhat.com> > > > > For "dirty-bitmap" sync mode, the block job will iterate through the > > given dirty bitmap to decide if a sector needs backup (backup all the > > dirty clusters and skip clean ones), just as allocation conditions of > > "top" sync mode. > > > > There are two bitmap use modes for sync=dirty-bitmap: > > > > - reset: backup job makes a copy of bitmap and resets the original > > one. > > - consume: backup job makes the original anonymous (invisible to user) > > and releases it after use. > > It's not obvious to me that we need both modes. Can you explain why the > choice between reset and consume is necessary?
Reset is used in continuous incremental backup, which is obvious: user can track the new data that comes after this drive-backup starts. Consume is better when user has no intention to use this dirty bitmap afterward. It comes with more convenience and less overhead: no need to explicitly free the bitmap, and no need for drive-backup job to copy the dirty bitmap. Copy shouldn't be too slow if it's just in memory, but it does require 2x memory anyway. Alternatively these can all be implemented with transactions. Fam