diff options
author | Avi Kivity <avi@qumranet.com> | 2007-04-15 09:31:09 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-05-03 03:52:29 -0400 |
commit | b5a33a75720c03d58d8281a72b45ffd214f00ed7 (patch) | |
tree | 7451b196f292eb96caf5173ad3c6459ab9efb1d7 /drivers/kvm/kvm_main.c | |
parent | 417726a3fbecb2092f1054bbaee87bc442b05ef3 (diff) |
KVM: Use slab caches to allocate mmu data structures
Better leak detection, statistics, memory use, speed -- goodness all
around.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r-- | drivers/kvm/kvm_main.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 0b30631585bd..ab4dbd7fa5f8 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -3063,6 +3063,10 @@ static __init int kvm_init(void) | |||
3063 | static struct page *bad_page; | 3063 | static struct page *bad_page; |
3064 | int r; | 3064 | int r; |
3065 | 3065 | ||
3066 | r = kvm_mmu_module_init(); | ||
3067 | if (r) | ||
3068 | goto out4; | ||
3069 | |||
3066 | r = register_filesystem(&kvm_fs_type); | 3070 | r = register_filesystem(&kvm_fs_type); |
3067 | if (r) | 3071 | if (r) |
3068 | goto out3; | 3072 | goto out3; |
@@ -3091,6 +3095,8 @@ out: | |||
3091 | out2: | 3095 | out2: |
3092 | unregister_filesystem(&kvm_fs_type); | 3096 | unregister_filesystem(&kvm_fs_type); |
3093 | out3: | 3097 | out3: |
3098 | kvm_mmu_module_exit(); | ||
3099 | out4: | ||
3094 | return r; | 3100 | return r; |
3095 | } | 3101 | } |
3096 | 3102 | ||
@@ -3100,6 +3106,7 @@ static __exit void kvm_exit(void) | |||
3100 | __free_page(pfn_to_page(bad_page_address >> PAGE_SHIFT)); | 3106 | __free_page(pfn_to_page(bad_page_address >> PAGE_SHIFT)); |
3101 | mntput(kvmfs_mnt); | 3107 | mntput(kvmfs_mnt); |
3102 | unregister_filesystem(&kvm_fs_type); | 3108 | unregister_filesystem(&kvm_fs_type); |
3109 | kvm_mmu_module_exit(); | ||
3103 | } | 3110 | } |
3104 | 3111 | ||
3105 | module_init(kvm_init) | 3112 | module_init(kvm_init) |