[PATCH] Fix boot-time slowdown for measure_migration_cost