libxl_wait_for_memory_target: wait for 2 sec at a time

Use a 2 sec sleep time in the loop to allow the guest to release a
decent amount of memory in an iteration (empirical tests show ballooning
speed to be 512MB/sec or recent boxes).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Mike Latimer <mlatimer@suse.com>
Tested-by: Mike Latimer <mlatimer@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Stefano Stabellini authored and Ian Campbell committed 2015-03-11 11:36:38 +00:00
1 parent 883b30a096
commit 0c8d70336b
1 file changed
+2 -2
+2 -2
View File
@@ -4970,7 +4970,7 @@ int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs)
prev_memkb = UINT64_MAX;
do {
sleep(1);
sleep(2);
libxl_dominfo_dispose(&info);
libxl_dominfo_init(&info);
@@ -4986,7 +4986,7 @@ int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs)
goto out;
}
else if (current_memkb == prev_memkb)
wait_secs--;
wait_secs -= 2;
/* if current_memkb < prev_memkb loop for free as progress has
* been made */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.