On 11/14/2011 12:56 PM, Takuya Yoshikawa wrote: > (2011/11/14 19:25), Avi Kivity wrote: >> On 11/14/2011 11:20 AM, Takuya Yoshikawa wrote: >>> This is a revised version of my previous work. I hope that >>> the patches are more self explanatory than before. >>> >> >> It looks good. I'll let Marcelo (or anyone else?) review it as well >> before applying. >> >> Do you have performance measurements? >> > > For VGA, 30-40us became 3-5us when the display was quiet, with a > enough warmed up guest. > That's a nice improvement. > Near the criterion, the number was not different much from the > original version. > > For live migration, I forgot the number but the result was good. > But my test case was not enough to cover every pattern, so I changed > the criterion to be a bit conservative. > > More tests may be able to find a better criterion. > I am not in a hurry about this, so it is OK to add some tests > before merging this. I think we can merge is as is, it's clear we get an improvement. > > But what I did not like was holding spin lock more than 100us or so > with the original version. With this version, at least, the problem > should be cured some. There was a patchset from Peter Zijlstra that converted mmu notifiers to be preemptible, with that, we can convert the mmu spinlock to a mutex, I'll see what happened to it. There is a third method of doing write protection, and that is by write-protecting at the higher levels of the paging hierarchy. The advantage there is that write protection is O(1) no matter how large the guest is, or the number of dirty pages. To write protect all guest memory, we just write protect the 512 PTEs at the very top, and leave the rest alone. When the guest writes to a page, we allow writes for the top-level PTE that faulted, and write-protect all the PTEs that it points to. We can combine it with your method by having a small bitmap (say, just 64 bits) per shadow page. Each bit represents 8 PTEs (total 512 PTEs) and is set if any of those PTEs are writeable. > > Takuya > > > One note: > > kvm-unit-tests' dirty logging test was broken for 32-bit box: compile > error. > I changed an "idt" to "boot_idt" and used it. > > I do not know kvm-unit-tests well, so I want somebody to fix that > officially. I'll look into it. -- error compiling committee.c: too many arguments to function -- 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