public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] KVM: make get dirty log ioctl return the first dirty page's position
@ 2010-02-24  8:43 Takuya Yoshikawa
  2010-02-24  8:45 ` [PATCH 1/1] " Takuya Yoshikawa
  2010-02-24  8:55 ` [PATCH 0/1] " Avi Kivity
  0 siblings, 2 replies; 9+ messages in thread
From: Takuya Yoshikawa @ 2010-02-24  8:43 UTC (permalink / raw)
  To: avi, mtosatti; +Cc: kvm

Some weeks ago, OHMURA Kei revised the qemu-kvm's
dirty bitmap scan by accessing the bitmap as an
unsigned long array.

By reviewing this work more, we notice that kernel
side is doing a similar thing to check the bitmap is
all clean or not.

So I made a patch which makes the get dirty log ioctl
return the first dirty page position found by this check.

Though my test is not enough to show the effect of this
patch, the fact that this patch has no bad effect to both
performance and implementation logic and we can skip some
extra memory accesses and comparisons in userspace seems
to be suggesting this patch is promising, right?


Below is a simple test result that compares the newly
obtained ioctl's return value to the slot len.
---
Host: AMD Phenom II
Guest memory size: 512M
Explanation: during migration, dumped the ioctl's return
  value(r) in kvm_get_map(), with no specific workload.

static int kvm_get_map(kvm_context_t kvm, int ioctl_num, int slot, void *buf)
{
...
    r = kvm_vm_ioctl(kvm_state, ioctl_num, &log);
    /* test: compare the return value and the slot's length */
    fprintf(stderr, "kvm_get_map(slot%2d): r=%5d, slot.len=%10lu(%lu)\n",
            slot, r, slots[slot].len,
            slots[slot].len / (4*1024) / (8*sizeof(unsigned long)));
...
}

Result:
...
kvm_get_map(slot 0): r=    3, slot.len=    655360(2)
kvm_get_map(slot 1): r= 2044, slot.len= 535822336(2044)
kvm_get_map(slot 2): r=    1, slot.len=    131072(0)
kvm_get_map(slot 3): r=    1, slot.len=    131072(0)
kvm_get_map(slot 4): r=    1, slot.len=    131072(0)
kvm_get_map(slot 5): r=   64, slot.len=  16777216(64)
kvm_get_map(slot 6): r=    1, slot.len=     32768(0)
kvm_get_map(slot 7): r=    1, slot.len=     32768(0)
kvm_get_map(slot 0): r=    3, slot.len=    655360(2)
kvm_get_map(slot 1): r= 2044, slot.len= 535822336(2044)
kvm_get_map(slot 2): r=    1, slot.len=    131072(0)
kvm_get_map(slot 3): r=    1, slot.len=    131072(0)
kvm_get_map(slot 4): r=    1, slot.len=    131072(0)
kvm_get_map(slot 5): r=   64, slot.len=  16777216(64)
kvm_get_map(slot 6): r=    1, slot.len=     32768(0)
kvm_get_map(slot 7): r=    1, slot.len=     32768(0)
kvm_get_map(slot 0): r=    3, slot.len=    655360(2)
kvm_get_map(slot 1): r= 2044, slot.len= 535822336(2044)
kvm_get_map(slot 2): r=    1, slot.len=    131072(0)
kvm_get_map(slot 3): r=    1, slot.len=    131072(0)
kvm_get_map(slot 4): r=    1, slot.len=    131072(0)
kvm_get_map(slot 5): r=   64, slot.len=  16777216(64)
kvm_get_map(slot 6): r=    1, slot.len=     32768(0)
kvm_get_map(slot 7): r=    1, slot.len=     32768(0)
kvm_get_map(slot 0): r=    3, slot.len=    655360(2)
kvm_get_map(slot 1): r= 2044, slot.len= 535822336(2044)
kvm_get_map(slot 2): r=    1, slot.len=    131072(0)
kvm_get_map(slot 3): r=    1, slot.len=    131072(0)
kvm_get_map(slot 4): r=    1, slot.len=    131072(0)
kvm_get_map(slot 5): r=   64, slot.len=  16777216(64)
kvm_get_map(slot 6): r=    1, slot.len=     32768(0)
kvm_get_map(slot 7): r=    1, slot.len=     32768(0)
...

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-02-24 10:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-24  8:43 [PATCH 0/1] KVM: make get dirty log ioctl return the first dirty page's position Takuya Yoshikawa
2010-02-24  8:45 ` [PATCH 1/1] " Takuya Yoshikawa
2010-02-24  8:55 ` [PATCH 0/1] " Avi Kivity
2010-02-24  8:59   ` Avi Kivity
2010-02-24  9:20     ` Takuya Yoshikawa
2010-02-24  9:42       ` Avi Kivity
2010-02-24  9:45   ` Takuya Yoshikawa
2010-02-24 10:03     ` Avi Kivity
2010-02-24 10:09       ` Takuya Yoshikawa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox