Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-04-18 Thread Gleb Natapov
On Wed, Apr 17, 2013 at 05:39:04PM -0300, Marcelo Tosatti wrote: On Fri, Mar 22, 2013 at 09:15:24PM +0200, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 08:37:33PM +0800, Xiao Guangrong wrote: On 03/22/2013 08:12 PM, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 08:03:04PM +0800, Xiao

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-04-18 Thread Marcelo Tosatti
On Thu, Apr 18, 2013 at 12:42:39PM +0300, Gleb Natapov wrote: that, but if not then less code is better. The number of sp-role.invalid=1 pages is small (only shadow roots). It can grow but is bounded to a handful. No improvement visible there. The number of shadow pages with old

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-04-18 Thread Gleb Natapov
On Thu, Apr 18, 2013 at 11:01:18AM -0300, Marcelo Tosatti wrote: On Thu, Apr 18, 2013 at 12:42:39PM +0300, Gleb Natapov wrote: that, but if not then less code is better. The number of sp-role.invalid=1 pages is small (only shadow roots). It can grow but is bounded to a handful. No

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-04-18 Thread Marcelo Tosatti
On Thu, Apr 18, 2013 at 07:36:03PM +0300, Gleb Natapov wrote: On Thu, Apr 18, 2013 at 11:01:18AM -0300, Marcelo Tosatti wrote: On Thu, Apr 18, 2013 at 12:42:39PM +0300, Gleb Natapov wrote: that, but if not then less code is better. The number of sp-role.invalid=1 pages is small

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-04-17 Thread Marcelo Tosatti
On Fri, Mar 22, 2013 at 09:15:24PM +0200, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 08:37:33PM +0800, Xiao Guangrong wrote: On 03/22/2013 08:12 PM, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 08:03:04PM +0800, Xiao Guangrong wrote: On 03/22/2013 07:47 PM, Gleb Natapov wrote: On Fri,

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-03-22 Thread Xiao Guangrong
On 03/22/2013 10:11 AM, Xiao Guangrong wrote: The modifications should be contained to kvm_mmu_get_page() mostly, correct? (would also have to keep counters to increase SLAB freeing ratio, relative to number of outdated shadow pages). Yes. And then have codepaths that nuke shadow pages

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-03-22 Thread Marcelo Tosatti
On Fri, Mar 22, 2013 at 10:11:17AM +0800, Xiao Guangrong wrote: On 03/22/2013 06:21 AM, Marcelo Tosatti wrote: On Wed, Mar 20, 2013 at 04:30:20PM +0800, Xiao Guangrong wrote: Changlog: V2: - do not reset n_requested_mmu_pages and n_max_mmu_pages - batch free root shadow pages to

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-03-22 Thread Xiao Guangrong
On 03/22/2013 06:54 PM, Marcelo Tosatti wrote: And then have codepaths that nuke shadow pages break from the spinlock, I think this is not needed any more. We can let mmu_notify use the generation number to invalid all shadow pages, then we only need to free them after all vcpus down and

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-03-22 Thread Gleb Natapov
On Fri, Mar 22, 2013 at 07:10:44PM +0800, Xiao Guangrong wrote: On 03/22/2013 06:54 PM, Marcelo Tosatti wrote: And then have codepaths that nuke shadow pages break from the spinlock, I think this is not needed any more. We can let mmu_notify use the generation number to invalid

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-03-22 Thread Xiao Guangrong
On 03/22/2013 07:28 PM, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 07:10:44PM +0800, Xiao Guangrong wrote: On 03/22/2013 06:54 PM, Marcelo Tosatti wrote: And then have codepaths that nuke shadow pages break from the spinlock, I think this is not needed any more. We can let mmu_notify use

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-03-22 Thread Gleb Natapov
On Fri, Mar 22, 2013 at 07:39:24PM +0800, Xiao Guangrong wrote: On 03/22/2013 07:28 PM, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 07:10:44PM +0800, Xiao Guangrong wrote: On 03/22/2013 06:54 PM, Marcelo Tosatti wrote: And then have codepaths that nuke shadow pages break from the

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-03-22 Thread Xiao Guangrong
On 03/22/2013 07:47 PM, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 07:39:24PM +0800, Xiao Guangrong wrote: On 03/22/2013 07:28 PM, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 07:10:44PM +0800, Xiao Guangrong wrote: On 03/22/2013 06:54 PM, Marcelo Tosatti wrote: And then have codepaths

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-03-22 Thread Gleb Natapov
On Fri, Mar 22, 2013 at 08:03:04PM +0800, Xiao Guangrong wrote: On 03/22/2013 07:47 PM, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 07:39:24PM +0800, Xiao Guangrong wrote: On 03/22/2013 07:28 PM, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 07:10:44PM +0800, Xiao Guangrong wrote: On

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-03-22 Thread Xiao Guangrong
On 03/22/2013 08:12 PM, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 08:03:04PM +0800, Xiao Guangrong wrote: On 03/22/2013 07:47 PM, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 07:39:24PM +0800, Xiao Guangrong wrote: On 03/22/2013 07:28 PM, Gleb Natapov wrote: On Fri, Mar 22, 2013 at

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-03-22 Thread Gleb Natapov
On Fri, Mar 22, 2013 at 08:37:33PM +0800, Xiao Guangrong wrote: On 03/22/2013 08:12 PM, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 08:03:04PM +0800, Xiao Guangrong wrote: On 03/22/2013 07:47 PM, Gleb Natapov wrote: On Fri, Mar 22, 2013 at 07:39:24PM +0800, Xiao Guangrong wrote: On

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-03-21 Thread Marcelo Tosatti
On Wed, Mar 20, 2013 at 04:30:20PM +0800, Xiao Guangrong wrote: Changlog: V2: - do not reset n_requested_mmu_pages and n_max_mmu_pages - batch free root shadow pages to reduce vcpu notification and mmu-lock contention - remove the first patch that introduce kvm-arch.mmu_cache since

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-03-21 Thread Xiao Guangrong
On 03/22/2013 06:21 AM, Marcelo Tosatti wrote: On Wed, Mar 20, 2013 at 04:30:20PM +0800, Xiao Guangrong wrote: Changlog: V2: - do not reset n_requested_mmu_pages and n_max_mmu_pages - batch free root shadow pages to reduce vcpu notification and mmu-lock contention - remove the

[PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-03-20 Thread Xiao Guangrong
Changlog: V2: - do not reset n_requested_mmu_pages and n_max_mmu_pages - batch free root shadow pages to reduce vcpu notification and mmu-lock contention - remove the first patch that introduce kvm-arch.mmu_cache since we only 'memset zero' on hashtable rather than all mmu cache