]> Git Repo - linux.git/commit
KVM: Dynamically size memslot array based on number of used slots
authorSean Christopherson <[email protected]>
Tue, 18 Feb 2020 21:07:32 +0000 (13:07 -0800)
committerPaolo Bonzini <[email protected]>
Mon, 16 Mar 2020 16:57:26 +0000 (17:57 +0100)
commit36947254e5f981aeeedab1c7dfa35fc34d330e80
treef0d27fa167eaa2902831e1485172288072e45617
parent0577d1abe704c315bb5cdfc71f4ca7b9b5358f59
KVM: Dynamically size memslot array based on number of used slots

Now that the memslot logic doesn't assume memslots are always non-NULL,
dynamically size the array of memslots instead of unconditionally
allocating memory for the maximum number of memslots.

Note, because a to-be-deleted memslot must first be invalidated, the
array size cannot be immediately reduced when deleting a memslot.
However, consecutive deletions will realize the memory savings, i.e.
a second deletion will trim the entry.

Tested-by: Christoffer Dall <[email protected]>
Tested-by: Marc Zyngier <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Signed-off-by: Sean Christopherson <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
include/linux/kvm_host.h
virt/kvm/kvm_main.c
This page took 0.057199 seconds and 4 git commands to generate.