Re: [PATCH v3 kvm/queue 05/16] KVM: Maintain ofs_tree for fast memslot lookup by file offset

2022-01-04 Thread Chao Peng
On Tue, Jan 04, 2022 at 05:43:50PM +, Sean Christopherson wrote: > On Fri, Dec 31, 2021, Chao Peng wrote: > > On Tue, Dec 28, 2021 at 09:48:08PM +, Sean Christopherson wrote: > > >KVM handles > > > reverse engineering the memslot to get the offset and whatever else it > > > needs. > > > no

Re: [PATCH v3 kvm/queue 05/16] KVM: Maintain ofs_tree for fast memslot lookup by file offset

2022-01-04 Thread Sean Christopherson
On Fri, Dec 31, 2021, Chao Peng wrote: > On Tue, Dec 28, 2021 at 09:48:08PM +, Sean Christopherson wrote: > >KVM handles > > reverse engineering the memslot to get the offset and whatever else it > > needs. > > notify_fallocate() and other callbacks are unchanged, though they probably > > can

Re: [PATCH v3 kvm/queue 05/16] KVM: Maintain ofs_tree for fast memslot lookup by file offset

2021-12-30 Thread Chao Peng
On Tue, Dec 28, 2021 at 09:48:08PM +, Sean Christopherson wrote: > On Fri, Dec 24, 2021, Chao Peng wrote: > > On Thu, Dec 23, 2021 at 06:02:33PM +, Sean Christopherson wrote: > > > On Thu, Dec 23, 2021, Chao Peng wrote: > > > > > > In other words, there needs to be a 1:1 gfn:file+offset ma

Re: [PATCH v3 kvm/queue 05/16] KVM: Maintain ofs_tree for fast memslot lookup by file offset

2021-12-28 Thread Sean Christopherson
On Fri, Dec 24, 2021, Chao Peng wrote: > On Thu, Dec 23, 2021 at 06:02:33PM +, Sean Christopherson wrote: > > On Thu, Dec 23, 2021, Chao Peng wrote: > > > Similar to hva_tree for hva range, maintain interval tree ofs_tree for > > > offset range of a fd-based memslot so the lookup by offset rang

Re: [PATCH v3 kvm/queue 05/16] KVM: Maintain ofs_tree for fast memslot lookup by file offset

2021-12-27 Thread Yao Yuan
On Fri, Dec 24, 2021 at 11:54:18AM +0800, Chao Peng wrote: > On Thu, Dec 23, 2021 at 06:02:33PM +, Sean Christopherson wrote: > > On Thu, Dec 23, 2021, Chao Peng wrote: > > > Similar to hva_tree for hva range, maintain interval tree ofs_tree for > > > offset range of a fd-based memslot so the l

Re: [PATCH v3 kvm/queue 05/16] KVM: Maintain ofs_tree for fast memslot lookup by file offset

2021-12-23 Thread Chao Peng
On Thu, Dec 23, 2021 at 06:02:33PM +, Sean Christopherson wrote: > On Thu, Dec 23, 2021, Chao Peng wrote: > > Similar to hva_tree for hva range, maintain interval tree ofs_tree for > > offset range of a fd-based memslot so the lookup by offset range can be > > faster when memslot count is high.

Re: [PATCH v3 kvm/queue 05/16] KVM: Maintain ofs_tree for fast memslot lookup by file offset

2021-12-23 Thread Sean Christopherson
On Thu, Dec 23, 2021, Chao Peng wrote: > Similar to hva_tree for hva range, maintain interval tree ofs_tree for > offset range of a fd-based memslot so the lookup by offset range can be > faster when memslot count is high. This won't work. The hva_tree relies on there being exactly one virtual ad

[PATCH v3 kvm/queue 05/16] KVM: Maintain ofs_tree for fast memslot lookup by file offset

2021-12-23 Thread Chao Peng
Similar to hva_tree for hva range, maintain interval tree ofs_tree for offset range of a fd-based memslot so the lookup by offset range can be faster when memslot count is high. Signed-off-by: Chao Peng --- include/linux/kvm_host.h | 2 ++ virt/kvm/kvm_main.c | 17 + 2 file