[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <05848766-b13c-2a58-81da-0f1e839a6cd0@redhat.com>
Date: Fri, 7 May 2021 09:40:23 +0200
From: David Hildenbrand <david@...hat.com>
To: Ben Gardon <bgardon@...gle.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: Paolo Bonzini <pbonzini@...hat.com>, Peter Xu <peterx@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Peter Shier <pshier@...gle.com>,
Yulei Zhang <yulei.kernel@...il.com>,
Wanpeng Li <kernellwp@...il.com>,
Xiao Guangrong <xiaoguangrong.eric@...il.com>,
Kai Huang <kai.huang@...el.com>,
Keqian Zhu <zhukeqian1@...wei.com>
Subject: Re: [PATCH v3 0/8] Lazily allocate memslot rmaps
On 06.05.21 20:42, Ben Gardon wrote:
> This series enables KVM to save memory when using the TDP MMU by waiting
> to allocate memslot rmaps until they are needed. To do this, KVM tracks
> whether or not a shadow root has been allocated. In order to get away
> with not allocating the rmaps, KVM must also be sure to skip operations
> which iterate over the rmaps. If the TDP MMU is in use and we have not
> allocated a shadow root, these operations would essentially be op-ops
> anyway. Skipping the rmap operations has a secondary benefit of avoiding
> acquiring the MMU lock in write mode in many cases, substantially
> reducing MMU lock contention.
>
> This series was tested on an Intel Skylake machine. With the TDP MMU off
> and on, this introduced no new failures on kvm-unit-tests or KVM selftests.
>
Happy to see this change pop up, I remember discussing this with Paolo
recently.
Another step to reduce the rmap overhead could be looking into using a
dynamic datastructure to manage the rmap, instead of allocating a
fixed-sized array. That could also significantly reduce memory overhead
in some setups and give us more flexibility, for example, for resizing
or splitting slots atomically.
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists