diff options
author | Avi Kivity <avi@qumranet.com> | 2008-03-26 11:39:12 +0200 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-03-26 11:39:12 +0200 |
commit | c0af88e9014019f6392b06c11e836ca58acc7ede (patch) | |
tree | bbe5428bb5842255a748a274509635650189b451 | |
parent | 7ea160be9a732ef6a77586d4b93da726f181fc3b (diff) |
This reverts commit 202761268a29d4cd3a3fec35e6d6f2f239374635. The change
caused a cycle that wouldn't let virtual machines to be deallocated (due to
the mm holding a ref to the file table, which holds a ref to kvm).
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r-- | virt/kvm/kvm_main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index a96a44f4e40d..30bf832c2362 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -186,7 +186,8 @@ static struct kvm *kvm_create_vm(void) if (IS_ERR(kvm)) goto out; - kvm->mm = get_task_mm(current); + kvm->mm = current->mm; + atomic_inc(&kvm->mm->mm_count); spin_lock_init(&kvm->mmu_lock); kvm_io_bus_init(&kvm->pio_bus); mutex_init(&kvm->lock); @@ -238,7 +239,7 @@ static void kvm_destroy_vm(struct kvm *kvm) kvm_io_bus_destroy(&kvm->pio_bus); kvm_io_bus_destroy(&kvm->mmio_bus); kvm_arch_destroy_vm(kvm); - mmput(mm); + mmdrop(mm); } static int kvm_vm_release(struct inode *inode, struct file *filp) |