(2010/11/22 14:40), Takuya Yoshikawa wrote:
Hi, I updated my patch set with your comments reflected.
Changelog: - used enum - lpage_idx issues - function names - measurements
- [PATCH 1/4] KVM: fix race condition in kvm_mmu_slot_remove_write_access() - [PATCH 2/4] KVM: introduce helper to access lpage_info - [PATCH 3/4] KVM: count the number of dirty pages for each memslot - [RFC PATCH 4/4] KVM: selective write protection using dirty bitmap The first one is a small fix and maybe worth applying seperately. The second and third are preparation for the last one, but I believe each has its own value. I measured the time consumed by kvm_mmu_slot_remove_write_access[_mask]() to decide at which conditions we choose *_mask(). Please check below! * I implemented dirty_level_memslot() based on these results. See [PATCH 4] Is it possible to apply [PATCH 1 and 2] first? It will help me a lot to concentrate on the main part. Takuya === Test - On core 2 duo machine (without EPT) => just because there was already test environment. - 1GB RAM for the guest - Workloads: x11perf for frame buffer test "find /" loop for live-migration test - Time was measured by rdtscll kvm mask: our method kvm orig: original method a) Frame buffer --------------------------------------------------------------- kernel: [ 5584.954209] kvm: nr_dirty_pages/npages = 8/4096 kernel: [ 5584.954240] kvm mask: time(tsc) = 9485 kernel: [ 5992.185125] kvm: nr_dirty_pages/npages = 7/4096 kernel: [ 5992.185389] kvm orig: time(tsc) = 444724 45 times faster --------------------------------------------------------------- kernel: [ 5588.330585] kvm: nr_dirty_pages/npages = 80/4096 kernel: [ 5588.330623] kvm mask: time(tsc) = 16688 kernel: [ 5996.183982] kvm: nr_dirty_pages/npages = 80/4096 kernel: [ 5996.184275] kvm orig: time(tsc) = 495551 30 times faster --------------------------------------------------------------- kernel: [ 5578.156641] kvm: nr_dirty_pages/npages = 195/4096 kernel: [ 5578.156690] kvm mask: time(tsc) = 27335 kernel: [ 5985.109688] kvm: nr_dirty_pages/npages = 195/4096 kernel: [ 5985.109820] kvm orig: time(tsc) = 194530 7 times faster --------------------------------------------------------------- kernel: [ 5605.821017] kvm: nr_dirty_pages/npages = 375/4096 kernel: [ 5605.821077] kvm mask: time(tsc) = 35049 kernel: [ 6014.627767] kvm: nr_dirty_pages/npages = 375/4096 kernel: [ 6014.628190] kvm orig: time(tsc) = 702737 20 times faster --------------------------------------------------------------- kernel: [ 5573.551459] kvm: nr_dirty_pages/npages = 576/4096 kernel: [ 5573.551532] kvm mask: time(tsc) = 46718 kernel: [ 5981.486862] kvm: nr_dirty_pages/npages = 576/4096 kernel: [ 5981.487036] kvm orig: time(tsc) = 210385 5 times faster --------------------------------------------------------------- b) Live-migration (1GB RAM) --------------------------------------------------------------- kernel: [ 5011.599573] kvm: nr_dirty_pages/npages = 52/261888 kernel: [ 5011.599624] kvm mask: time(tsc) = 33712 kernel: [ 4297.465401] kvm: nr_dirty_pages/npages = 50/261888 kernel: [ 4297.465918] kvm orig: time(tsc) = 894593 25 times faster --------------------------------------------------------------- kernel: [ 5009.045842] kvm: nr_dirty_pages/npages = 120/261888 kernel: [ 5009.045940] kvm mask: time(tsc) = 50575 kernel: [ 4295.438092] kvm: nr_dirty_pages/npages = 106/261888 kernel: [ 4295.438427] kvm orig: time(tsc) = 525140 10 times faster --------------------------------------------------------------- kernel: [ 5016.914031] kvm: nr_dirty_pages/npages = 251/261888 kernel: [ 5016.914160] kvm mask: time(tsc) = 78750 kernel: [ 4297.265937] kvm: nr_dirty_pages/npages = 260/261888 kernel: [ 4297.266411] kvm orig: time(tsc) = 782446 10 times faster --------------------------------------------------------------- kernel: [ 5015.717535] kvm: nr_dirty_pages/npages = 526/261888 kernel: [ 5015.717697] kvm mask: time(tsc) = 130137 kernel: [ 4295.370101] kvm: nr_dirty_pages/npages = 596/261888 kernel: [ 4295.370589] kvm orig: time(tsc) = 644805 5 times faster --------------------------------------------------------------- kernel: [ 5011.693010] kvm: nr_dirty_pages/npages = 1029/261888 kernel: [ 5011.693177] kvm mask: time(tsc) = 219863 kernel: [ 4295.760635] kvm: nr_dirty_pages/npages = 1025/261888 kernel: [ 4295.761078] kvm orig: time(tsc) = 767333 3 times faster --------------------------------------------------------------- kernel: [ 5014.805403] kvm: nr_dirty_pages/npages = 2219/261888 kernel: [ 5014.805676] kvm mask: time(tsc) = 454314 kernel: [ 4302.186712] kvm: nr_dirty_pages/npages = 1982/261888 kernel: [ 4302.191418] kvm orig: time(tsc) = 2294187 5 times faster --------------------------------------------------------------- kernel: [ 5015.305794] kvm: nr_dirty_pages/npages = 4143/261888 kernel: [ 5015.306291] kvm mask: time(tsc) = 847175 kernel: [ 4302.068376] kvm: nr_dirty_pages/npages = 3835/261888 kernel: [ 4302.069456] kvm orig: time(tsc) = 1855105 3 times faster --------------------------------------------------------------- -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
-- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html