lkml.org 
[lkml]   [2021]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 0/8] Lazily allocate memslot rmaps
From
Date
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

\
 
 \ /
  Last update: 2021-05-07 09:40    [W:0.268 / U:0.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site