]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: replace x86 kvm n_free_mmu_pages with n_used_mmu_pages
authorDave Hansen <dave@linux.vnet.ibm.com>
Fri, 20 Aug 2010 01:11:28 +0000 (18:11 -0700)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:51:18 +0000 (10:51 +0200)
commit2d60fcbd2658694c9127da841bd6c6303fb781b6
tree180d5d2926e1282654c2c9438612aa567d9eb68f
parentc6dd2f42c331f58270b7a35a8aebf34e0ba0393f
KVM: replace x86 kvm n_free_mmu_pages with n_used_mmu_pages

Doing this makes the code much more readable.  That's
borne out by the fact that this patch removes code.  "used"
also happens to be the number that we need to return back to
the slab code when our shrinker gets called.  Keeping this
value as opposed to free makes the next patch simpler.

So, 'struct kvm' is kzalloc()'d.  'struct kvm_arch' is a
structure member (and not a pointer) of 'struct kvm'.  That
means they start out zeroed.  I _think_ they get initialized
properly by kvm_mmu_change_mmu_pages().  But, that only happens
via kvm ioctls.

Another benefit of storing 'used' intead of 'free' is
that the values are consistent from the moment the structure is
allocated: no negative "used" value.

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Tim Pepper <lnxninja@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu.c
arch/x86/kvm/mmu.h