Re: [PATCH 6/6] KVM: MMU: fast zap all shadow pages

2013-03-19 Thread Marcelo Tosatti
On Tue, Mar 19, 2013 at 11:37:38PM +0800, Xiao Guangrong wrote: > On 03/19/2013 10:40 PM, Marcelo Tosatti wrote: > > > > > I misunderstood the benefit of your idea (now i got it: zap root > > and flush TLB guarantees vcpus will refault). What i'd like to avoid is > > > > memset(cache, 0, sizeof(

Re: [PATCH 6/6] KVM: MMU: fast zap all shadow pages

2013-03-19 Thread Xiao Guangrong
On 03/19/2013 10:40 PM, Marcelo Tosatti wrote: > > I misunderstood the benefit of your idea (now i got it: zap root > and flush TLB guarantees vcpus will refault). What i'd like to avoid is > > memset(cache, 0, sizeof(*cache)); > kvm_mmu_init(kvm); > > I'd prefer normal operations on those data

Re: [PATCH 6/6] KVM: MMU: fast zap all shadow pages

2013-03-19 Thread Marcelo Tosatti
On Tue, Mar 19, 2013 at 11:06:35AM +0800, Xiao Guangrong wrote: > On 03/19/2013 04:46 AM, Marcelo Tosatti wrote: > > On Wed, Mar 13, 2013 at 12:59:12PM +0800, Xiao Guangrong wrote: > >> The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to > >> walk and zap all shadow pages one by

Re: [PATCH 6/6] KVM: MMU: fast zap all shadow pages

2013-03-18 Thread Xiao Guangrong
On 03/19/2013 04:46 AM, Marcelo Tosatti wrote: > On Wed, Mar 13, 2013 at 12:59:12PM +0800, Xiao Guangrong wrote: >> The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to >> walk and zap all shadow pages one by one, also it need to zap all guest >> page's rmap and all shadow page's

Re: [PATCH 6/6] KVM: MMU: fast zap all shadow pages

2013-03-18 Thread Marcelo Tosatti
On Wed, Mar 13, 2013 at 12:59:12PM +0800, Xiao Guangrong wrote: > The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to > walk and zap all shadow pages one by one, also it need to zap all guest > page's rmap and all shadow page's parent spte list. Particularly, things > become wors

Re: [PATCH 6/6] KVM: MMU: fast zap all shadow pages

2013-03-13 Thread Xiao Guangrong
On 03/14/2013 09:35 AM, Marcelo Tosatti wrote: > On Wed, Mar 13, 2013 at 10:07:06PM -0300, Marcelo Tosatti wrote: >> On Wed, Mar 13, 2013 at 12:59:12PM +0800, Xiao Guangrong wrote: >>> The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to >>> walk and zap all shadow pages one by on

Re: [PATCH 6/6] KVM: MMU: fast zap all shadow pages

2013-03-13 Thread Marcelo Tosatti
On Wed, Mar 13, 2013 at 10:07:06PM -0300, Marcelo Tosatti wrote: > On Wed, Mar 13, 2013 at 12:59:12PM +0800, Xiao Guangrong wrote: > > The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to > > walk and zap all shadow pages one by one, also it need to zap all guest > > page's rmap a

Re: [PATCH 6/6] KVM: MMU: fast zap all shadow pages

2013-03-13 Thread Marcelo Tosatti
On Wed, Mar 13, 2013 at 12:59:12PM +0800, Xiao Guangrong wrote: > The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to > walk and zap all shadow pages one by one, also it need to zap all guest > page's rmap and all shadow page's parent spte list. Particularly, things > become wors

[PATCH 6/6] KVM: MMU: fast zap all shadow pages

2013-03-12 Thread Xiao Guangrong
The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to walk and zap all shadow pages one by one, also it need to zap all guest page's rmap and all shadow page's parent spte list. Particularly, things become worse if guest uses more memory or vcpus. It is not good for scalability. S