> Spreading the work to free (or reuse) those shadow pages to individual > takes a long time (therefore the suggestion to postpone it). > Returning all shadow pages to the allocator is problematic because it > The number of shadow pages with old mmu_gen_number is potentially large. > The number of sp->role.invalid=1 pages is small (only shadow roots). > that, but if not then less code is better. > advantage of reusing invalid pages in kvm_mmu_get_page() lets do it like > is proposed above for them too (am I right?). > We did not do that for sp->role.invalid pages although we could do what > not need to change kvm_mmu_get_page() at all. > And I am saying that if you make mmu_gen_number part of the role you do > if (sp->mmu_gen_number != kvm->arch.mmu_gen_number) > VM global generetion number, zap the roots and then on kvm_mmu_get_page: > And then for the cases where performance matters just increase a > I still think the right way to fix this kind of thing is optimization for > most is that host remains unaffected (and that it finishes in a > mmu_notifier_release, kvm_destroy_vm, etc. > cases, where there is no detailed concern about performance. > Yes, but the suggestion is to use spin_needbreak on the VM shutdown > the worst case is, it can not completed forever on intensive vcpu and memory zap-all-shadow-page need long time to be finished, > mmu-lock, then zap-all-shadow-pages release mmu-lock and wait, other vcpus > Especially, zap-all-shadow-pages can let other vcpus fault and vcpus contest > not fix the hot-lock contention and it just occupies more cpu time to avoid > BTW, to my honest, i do not think spin_needbreak is a good way - it does > such as kvm_mmu_slot_remove_write_access does now (spin_needbreak). > all vcpus down and mmu_notify unregistered - at this point, no lock contention, > number to invalid all shadow pages, then we only need to free them after > And then have codepaths that nuke shadow pages break from the spinlock, On Wed, at 05:39:04PM -0300, Marcelo Tosatti wrote: Next in thread: Marcelo Tosatti: "Re: KVM: MMU: fast zap all shadow pages".In reply to: Marcelo Tosatti: "Re: KVM: MMU: fast zap all shadow pages".Previous message: Luis Henriques: " ASoC: imx-ssi: Fix occasional AC97 reset failure".Next message: Pavel Emelyanov: " kernel/posix-timers.c: Fix unused variable".Linux-Kernel Archive: Re: KVM: MMU: fast zap all shadow pages Re: KVM: MMU: fast zap all shadow pages From: Gleb Natapov
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |