On 05/30/2018 08:47 PM, Michael S. Tsirkin wrote:
On Wed, May 30, 2018 at 05:12:09PM +0800, Wei Wang wrote:
On 05/29/2018 11:24 PM, Michael S. Tsirkin wrote:
On Tue, Apr 24, 2018 at 02:13:47PM +0800, Wei Wang wrote:
+/*
+ * Balloon will report pages which were free at the time of this call. As the
+ * reporting happens asynchronously, dirty bit logging must be enabled before
+ * this call is made.
+ */
+void balloon_free_page_start(void)
+{
+ balloon_free_page_start_fn(balloon_opaque);
+}
Please create notifier support, not a single global.
OK. The start is called at the end of bitmap_sync, and the stop is called at
the beginning of bitmap_sync. In this case, we will need to add two
migration states, MIGRATION_STATUS_BEFORE_BITMAP_SYNC and
MIGRATION_STATUS_AFTER_BITMAP_SYNC, right?
Peter, do you have any thought about this?
Currently, the usage of free page optimization isn't limited to the
first stage. It is used in each stage. A global call to start the free
page optimization is made after bitmap sync, and another global call to
stop the optimization is made before bitmap sync. It is simple to just
use global calls.
If we change the implementation to use notifiers, I think we will need
to add two new MigrationStatus as above. Would you think that is
worthwhile for some reason?
Best,
Wei