Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197816
b: refs/heads/master
c: d35b8dd
h: refs/heads/master
v: v3
  • Loading branch information
Gui Jianfeng authored and Avi Kivity committed May 19, 2010
1 parent 7da7ccf commit 28b86d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a7388c2d2faa2cc70c2d4717c8d7836d55459e0
refs/heads/master: d35b8dd9355805f17225fdbfee4bc704d7bf7547
10 changes: 5 additions & 5 deletions trunk/arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2902,13 +2902,13 @@ void kvm_mmu_zap_all(struct kvm *kvm)
kvm_flush_remote_tlbs(kvm);
}

static void kvm_mmu_remove_one_alloc_mmu_page(struct kvm *kvm)
static int kvm_mmu_remove_some_alloc_mmu_pages(struct kvm *kvm)
{
struct kvm_mmu_page *page;

page = container_of(kvm->arch.active_mmu_pages.prev,
struct kvm_mmu_page, link);
kvm_mmu_zap_page(kvm, page);
return kvm_mmu_zap_page(kvm, page) + 1;
}

static int mmu_shrink(int nr_to_scan, gfp_t gfp_mask)
Expand All @@ -2920,16 +2920,16 @@ static int mmu_shrink(int nr_to_scan, gfp_t gfp_mask)
spin_lock(&kvm_lock);

list_for_each_entry(kvm, &vm_list, vm_list) {
int npages, idx;
int npages, idx, freed_pages;

idx = srcu_read_lock(&kvm->srcu);
spin_lock(&kvm->mmu_lock);
npages = kvm->arch.n_alloc_mmu_pages -
kvm->arch.n_free_mmu_pages;
cache_count += npages;
if (!kvm_freed && nr_to_scan > 0 && npages > 0) {
kvm_mmu_remove_one_alloc_mmu_page(kvm);
cache_count--;
freed_pages = kvm_mmu_remove_some_alloc_mmu_pages(kvm);
cache_count -= freed_pages;
kvm_freed = kvm;
}
nr_to_scan--;
Expand Down

0 comments on commit 28b86d7

Please sign in to comment.