Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[linux-2.6-microblaze.git] / include / linux / kvm_types.h
index ac1ebb3..3ca3db0 100644 (file)
@@ -19,6 +19,7 @@ struct kvm_memslots;
 enum kvm_mr_change;
 
 #include <linux/bits.h>
+#include <linux/mutex.h>
 #include <linux/types.h>
 #include <linux/spinlock_types.h>
 
@@ -69,6 +70,7 @@ struct gfn_to_pfn_cache {
        struct kvm_vcpu *vcpu;
        struct list_head list;
        rwlock_t lock;
+       struct mutex refresh_lock;
        void *khva;
        kvm_pfn_t pfn;
        enum pfn_cache_usage usage;
@@ -83,12 +85,17 @@ struct gfn_to_pfn_cache {
  * MMU flows is problematic, as is triggering reclaim, I/O, etc... while
  * holding MMU locks.  Note, these caches act more like prefetch buffers than
  * classical caches, i.e. objects are not returned to the cache on being freed.
+ *
+ * The @capacity field and @objects array are lazily initialized when the cache
+ * is topped up (__kvm_mmu_topup_memory_cache()).
  */
 struct kvm_mmu_memory_cache {
        int nobjs;
        gfp_t gfp_zero;
+       gfp_t gfp_custom;
        struct kmem_cache *kmem_cache;
-       void *objects[KVM_ARCH_NR_OBJS_PER_MEMORY_CACHE];
+       int capacity;
+       void **objects;
 };
 #endif