All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: kvm@vger.kernel.org
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Subject: [patch 1/6] remove kvm_update_dirty_pages_log call from ram_save_block
Date: Tue, 23 Mar 2010 13:53:34 -0300	[thread overview]
Message-ID: <20100323165346.726052848@amt.cnet> (raw)
In-Reply-To: 20100323165333.062022913@amt.cnet

[-- Attachment #1: remove-saveram-kvm-update-dirty-log --]
[-- Type: text/plain, Size: 2300 bytes --]

There is no need to update the dirty log from inside ram_save_block, 
since this happens through cpu_physical_sync_dirty_bitmap.

In stage 3, where the VM is stopped, cpu_physical_sync_dirty_bitmap
guarantees dirty log is synchronized before migration finishes.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

Index: qemu-kvm-cleanups/vl.c
===================================================================
--- qemu-kvm-cleanups.orig/vl.c
+++ qemu-kvm-cleanups/vl.c
@@ -2782,15 +2782,6 @@ static int ram_save_block(QEMUFile *f)
     int found = 0;
 
     while (addr < last_ram_offset) {
-        if (kvm_enabled() && current_addr == 0) {
-            int r;
-            r = kvm_update_dirty_pages_log();
-            if (r) {
-                fprintf(stderr, "%s: update dirty pages log failed %d\n", __FUNCTION__, r);
-                qemu_file_set_error(f);
-                return 0;
-            }
-        }
         if (cpu_physical_memory_get_dirty(current_addr, MIGRATION_DIRTY_FLAG)) {
             uint8_t *p;
 
Index: qemu-kvm-cleanups/qemu-kvm.c
===================================================================
--- qemu-kvm-cleanups.orig/qemu-kvm.c
+++ qemu-kvm-cleanups/qemu-kvm.c
@@ -2338,20 +2338,6 @@ static int kvm_get_dirty_bitmap_cb(unsig
     return kvm_get_dirty_pages_log_range(start, bitmap, start, len);
 }
 
-/* 
- * get kvm's dirty pages bitmap and update qemu's
- * we only care about physical ram, which resides in slots 0 and 3
- */
-int kvm_update_dirty_pages_log(void)
-{
-    int r = 0;
-
-
-    r = kvm_get_dirty_pages_range(kvm_context, 0, -1UL, NULL,
-                                  kvm_get_dirty_bitmap_cb);
-    return r;
-}
-
 void kvm_qemu_log_memory(target_phys_addr_t start, target_phys_addr_t size,
                          int log)
 {
Index: qemu-kvm-cleanups/qemu-kvm.h
===================================================================
--- qemu-kvm-cleanups.orig/qemu-kvm.h
+++ qemu-kvm-cleanups/qemu-kvm.h
@@ -836,7 +836,6 @@ void kvm_hpet_disable_kpit(void);
 int kvm_set_irq(int irq, int level, int *status);
 
 int kvm_physical_memory_set_dirty_tracking(int enable);
-int kvm_update_dirty_pages_log(void);
 
 void qemu_kvm_call_with_env(void (*func)(void *), void *data, CPUState *env);
 void qemu_kvm_cpuid_on_env(CPUState *env);



  reply	other threads:[~2010-03-23 16:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-23 16:53 [patch 0/6] misc qemu-kvm cleanups Marcelo Tosatti
2010-03-23 16:53 ` Marcelo Tosatti [this message]
2010-03-23 16:53 ` [patch 2/6] make cpu_physical_memory_set_dirty_tracking equal to upstream Marcelo Tosatti
2010-03-23 16:53 ` [patch 3/6] remove unused bios_mem variable Marcelo Tosatti
2010-03-23 16:53 ` [patch 4/6] qemu-kvm: use upstream kvm_flush_coalesced_mmio_buffer Marcelo Tosatti
2010-03-23 16:53 ` [patch 5/6] qemu-kvm: remove unused qemu_kvm_get_dirty_pages Marcelo Tosatti
2010-03-23 16:53 ` [patch 6/6] qemu-kvm: use reset handler for vcpus Marcelo Tosatti
2010-03-24  9:42 ` [patch 0/6] misc qemu-kvm cleanups Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100323165346.726052848@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.