migration/next for 20151125
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABCAAGBQJWVcWfAAoJEPSH7xhYctcjl5sQAJ8i6AlwAuYFw0ilMAvVHyIQ m981FKNcHdB0UoS7tn//eR5io+zXDphBRChbvxa7A/U6/liMMb6Hf71M0nitb3ix AaXz2hPXOQE7xHAuefkTiinM9K4/aSbGbAStqv+lwMWnBYvadJj2LQg1sTTdupQT oaKk59c4NEW0JZeVoxNwnngHPw5L19OpN8Wd3SnBW9UsBDGaVqsXpo/iLPSqx9FH 8GVHck53r9GQPA/AaMm0a27KuX4OT/exLRJqS9rHRqAuAR+G/Q/Hsv1cXhF2Qs5z 2/wymh8eEXwwKZcPik0z6BVdChJeyXvRMCQJ62sPnCm1xFh2ZiWMeYoUlDNzura4 iu31dz8dz/8ZNOb9oIyAsQtYgnJ9n/42JIXRpL1uKvJ1nCYQPzejvPOWrVA7Mlv+ zoTDyvT7f048DVSovnDQc1G48Yj2y8vZrV64zVOjsY7oyIhAJKuT20EBtaXWtfty VZ8mJN9+EK+yl9d3q2e1Ua9Sqj5t4hoi792jniziIAA9W5aPfFsZRFc5v4tYfxKx 2jROWfxa8cS09d/ShTms5K8pCcq2QYzCANbEOgY2k+CSH+Odh9GtHDFAbWDuSddT xM6lFmWvUxiEH4fX9LLtLkVgvK3J66O3MWwrn1IkddIq5yZMnGfaLTW2qkBJv087 nRS3UBSwEipkJthHiOpd =0Wy1 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20151125' into staging migration/next for 20151125 # gpg: Signature made Wed 25 Nov 2015 14:28:47 GMT using RSA key ID 5872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" # gpg: aka "Juan Quintela <quintela@trasno.org>" * remotes/juanquintela/tags/migration/20151125: block-migration: limit the memory usage Assume madvise for (no)hugepage works Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
		
						commit
						c7933a80bc
					
				@ -36,6 +36,8 @@
 | 
			
		||||
 | 
			
		||||
#define MAX_IS_ALLOCATED_SEARCH 65536
 | 
			
		||||
 | 
			
		||||
#define MAX_INFLIGHT_IO 512
 | 
			
		||||
 | 
			
		||||
//#define DEBUG_BLK_MIGRATION
 | 
			
		||||
 | 
			
		||||
#ifdef DEBUG_BLK_MIGRATION
 | 
			
		||||
@ -665,7 +667,10 @@ static int block_save_iterate(QEMUFile *f, void *opaque)
 | 
			
		||||
    blk_mig_lock();
 | 
			
		||||
    while ((block_mig_state.submitted +
 | 
			
		||||
            block_mig_state.read_done) * BLOCK_SIZE <
 | 
			
		||||
           qemu_file_get_rate_limit(f)) {
 | 
			
		||||
           qemu_file_get_rate_limit(f) &&
 | 
			
		||||
           (block_mig_state.submitted +
 | 
			
		||||
            block_mig_state.read_done) <
 | 
			
		||||
           MAX_INFLIGHT_IO) {
 | 
			
		||||
        blk_mig_unlock();
 | 
			
		||||
        if (block_mig_state.bulk_completed == 0) {
 | 
			
		||||
            /* first finish the bulk phase */
 | 
			
		||||
 | 
			
		||||
@ -241,10 +241,7 @@ static int cleanup_range(const char *block_name, void *host_addr,
 | 
			
		||||
     * We turned off hugepage for the precopy stage with postcopy enabled
 | 
			
		||||
     * we can turn it back on now.
 | 
			
		||||
     */
 | 
			
		||||
    if (qemu_madvise(host_addr, length, QEMU_MADV_HUGEPAGE)) {
 | 
			
		||||
        error_report("%s HUGEPAGE: %s", __func__, strerror(errno));
 | 
			
		||||
        return -1;
 | 
			
		||||
    }
 | 
			
		||||
    qemu_madvise(host_addr, length, QEMU_MADV_HUGEPAGE);
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * We can also turn off userfault now since we should have all the
 | 
			
		||||
@ -345,10 +342,7 @@ static int nhp_range(const char *block_name, void *host_addr,
 | 
			
		||||
     * do delete areas of the page, even if THP thinks a hugepage would
 | 
			
		||||
     * be a good idea, so force hugepages off.
 | 
			
		||||
     */
 | 
			
		||||
    if (qemu_madvise(host_addr, length, QEMU_MADV_NOHUGEPAGE)) {
 | 
			
		||||
        error_report("%s: NOHUGEPAGE: %s", __func__, strerror(errno));
 | 
			
		||||
        return -1;
 | 
			
		||||
    }
 | 
			
		||||
    qemu_madvise(host_addr, length, QEMU_MADV_NOHUGEPAGE);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user