Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-26 Thread Marcelo Tosatti
for you? Looks fine, can you rerun kernbench? Subject: [PATCH 11/11] KVM: MMU: improve write flooding detected Detecting write-flooding does not work well, when we handle page written, if the last speculative spte is not accessed, we treat the page is write

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-26 Thread Xiao Guangrong
On 08/26/2011 06:53 PM, Marcelo Tosatti wrote: On Fri, Aug 26, 2011 at 11:18:01AM +0800, Xiao Guangrong wrote: On 08/25/2011 09:47 PM, Marcelo Tosatti wrote: I guess it is OK to be more trigger happy with zapping by ignoring the accessed bit, clearing the flood counter on page fault. Yeah,

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Xiao Guangrong
On 08/25/2011 10:04 AM, Marcelo Tosatti wrote: Yes, in this case, the sp is not zapped, but it is hardly to know the gfn is not used as gpte just depends on writing, for example, the guest can change the mapping address or the status bit, and so on...The sp can be zapped if the guest write it

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Xiao Guangrong
On 08/24/2011 03:09 AM, Marcelo Tosatti wrote: On Wed, Aug 24, 2011 at 12:32:32AM +0800, Xiao Guangrong wrote: On 08/23/2011 08:38 PM, Marcelo Tosatti wrote: And, i think there are not problems since: if the spte without accssed bit is written frequently, it means the guest page table is

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Marcelo Tosatti
On Thu, Aug 25, 2011 at 07:42:10AM +0300, Avi Kivity wrote: On 08/25/2011 05:04 AM, Marcelo Tosatti wrote: It could increase the flood count independently of the accessed bit of the spte being updated, zapping after 3 attempts as it is now. But additionally reset the flood count if

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Marcelo Tosatti
On Thu, Aug 25, 2011 at 03:57:22PM +0800, Xiao Guangrong wrote: On 08/24/2011 03:09 AM, Marcelo Tosatti wrote: On Wed, Aug 24, 2011 at 12:32:32AM +0800, Xiao Guangrong wrote: On 08/23/2011 08:38 PM, Marcelo Tosatti wrote: And, i think there are not problems since: if the spte without

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Avi Kivity
On 08/25/2011 05:06 PM, Avi Kivity wrote: On 08/25/2011 04:21 PM, Marcelo Tosatti wrote: On Thu, Aug 25, 2011 at 07:42:10AM +0300, Avi Kivity wrote: On 08/25/2011 05:04 AM, Marcelo Tosatti wrote: It could increase the flood count independently of the accessed bit of the spte being

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Avi Kivity
On 08/25/2011 04:21 PM, Marcelo Tosatti wrote: On Thu, Aug 25, 2011 at 07:42:10AM +0300, Avi Kivity wrote: On 08/25/2011 05:04 AM, Marcelo Tosatti wrote: It could increase the flood count independently of the accessed bit of the spte being updated, zapping after 3 attempts as it

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Xiao Guangrong
On 08/25/2011 09:47 PM, Marcelo Tosatti wrote: I guess it is OK to be more trigger happy with zapping by ignoring the accessed bit, clearing the flood counter on page fault. Yeah, i like this way, is this patch good for you? Subject: [PATCH 11/11] KVM: MMU

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-24 Thread Marcelo Tosatti
On Wed, Aug 24, 2011 at 04:16:52AM +0800, Xiao Guangrong wrote: On 08/24/2011 03:09 AM, Marcelo Tosatti wrote: On Wed, Aug 24, 2011 at 12:32:32AM +0800, Xiao Guangrong wrote: On 08/23/2011 08:38 PM, Marcelo Tosatti wrote: And, i think there are not problems since: if the spte without

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-24 Thread Marcelo Tosatti
On Wed, Aug 24, 2011 at 05:05:40PM -0300, Marcelo Tosatti wrote: On Wed, Aug 24, 2011 at 04:16:52AM +0800, Xiao Guangrong wrote: On 08/24/2011 03:09 AM, Marcelo Tosatti wrote: On Wed, Aug 24, 2011 at 12:32:32AM +0800, Xiao Guangrong wrote: On 08/23/2011 08:38 PM, Marcelo Tosatti wrote:

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-24 Thread Avi Kivity
On 08/25/2011 05:04 AM, Marcelo Tosatti wrote: It could increase the flood count independently of the accessed bit of the spte being updated, zapping after 3 attempts as it is now. But additionally reset the flood count if the gpte appears to be valid (points to an existant gfn if the

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-23 Thread Marcelo Tosatti
On Tue, Aug 16, 2011 at 02:46:47PM +0800, Xiao Guangrong wrote: Detecting write-flooding does not work well, when we handle page written, if the last speculative spte is not accessed, we treat the page is write-flooding, however, we can speculative spte on many path, such as pte prefetch, page

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-23 Thread Xiao Guangrong
Hi Marcelo, On 08/23/2011 04:00 PM, Marcelo Tosatti wrote: On Tue, Aug 16, 2011 at 02:46:47PM +0800, Xiao Guangrong wrote: Detecting write-flooding does not work well, when we handle page written, if the last speculative spte is not accessed, we treat the page is write-flooding, however, we

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-23 Thread Marcelo Tosatti
On Tue, Aug 23, 2011 at 06:55:39PM +0800, Xiao Guangrong wrote: Hi Marcelo, On 08/23/2011 04:00 PM, Marcelo Tosatti wrote: On Tue, Aug 16, 2011 at 02:46:47PM +0800, Xiao Guangrong wrote: Detecting write-flooding does not work well, when we handle page written, if the last speculative

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-23 Thread Xiao Guangrong
On 08/23/2011 08:38 PM, Marcelo Tosatti wrote: And, i think there are not problems since: if the spte without accssed bit is written frequently, it means the guest page table is accessed infrequently or during the writing, the guest page table is not accessed, in this time, zapping this

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-23 Thread Marcelo Tosatti
On Wed, Aug 24, 2011 at 12:32:32AM +0800, Xiao Guangrong wrote: On 08/23/2011 08:38 PM, Marcelo Tosatti wrote: And, i think there are not problems since: if the spte without accssed bit is written frequently, it means the guest page table is accessed infrequently or during the

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-23 Thread Xiao Guangrong
On 08/24/2011 03:09 AM, Marcelo Tosatti wrote: On Wed, Aug 24, 2011 at 12:32:32AM +0800, Xiao Guangrong wrote: On 08/23/2011 08:38 PM, Marcelo Tosatti wrote: And, i think there are not problems since: if the spte without accssed bit is written frequently, it means the guest page table is

[PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-16 Thread Xiao Guangrong
Detecting write-flooding does not work well, when we handle page written, if the last speculative spte is not accessed, we treat the page is write-flooding, however, we can speculative spte on many path, such as pte prefetch, page synced, that means the last speculative spte may be not point to

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-07-27 Thread Avi Kivity
On 07/26/2011 02:32 PM, Xiao Guangrong wrote: Detecting write-flooding does not work well, when we handle page written, if the last speculative spte is not accessed, we treat the page is write-flooding, however, we can speculative spte on many path, such as pte prefetch, page synced, that means

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-07-27 Thread Xiao Guangrong
On 07/27/2011 05:23 PM, Avi Kivity wrote: On 07/26/2011 02:32 PM, Xiao Guangrong wrote: Detecting write-flooding does not work well, when we handle page written, if the last speculative spte is not accessed, we treat the page is write-flooding, however, we can speculative spte on many path,

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-07-27 Thread Avi Kivity
On 07/27/2011 01:20 PM, Xiao Guangrong wrote: } I think this is a little dangerous. A guest kernel may be instantiating multiple gptes on a page fault, but guest userspace hits only one of them (the one which caused the page fault) - I think Windows does this, but I'm not sure. I

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-07-27 Thread Xiao Guangrong
On 07/27/2011 07:08 PM, Avi Kivity wrote: On 07/27/2011 01:20 PM, Xiao Guangrong wrote: } I think this is a little dangerous. A guest kernel may be instantiating multiple gptes on a page fault, but guest userspace hits only one of them (the one which caused the page fault) - I

[PATCH 11/11] KVM: MMU: improve write flooding detected

2011-07-26 Thread Xiao Guangrong
Detecting write-flooding does not work well, when we handle page written, if the last speculative spte is not accessed, we treat the page is write-flooding, however, we can speculative spte on many path, such as pte prefetch, page synced, that means the last speculative spte may be not point to