diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2010-06-11 09:32:34 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-08-01 03:46:43 -0400 |
commit | ebdea638df04ae6293a9a5414d98ad843c69e82f (patch) | |
tree | dc656eba6f0a0e0c9baa63c1b1116a19b913b349 /arch | |
parent | be71e061d15c0aad4f8c2606f76c57b8a19792fd (diff) |
KVM: MMU: cleanup for __mmu_unsync_walk()
Decrease sp->unsync_children after clear unsync_child_bitmap bit
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/mmu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index d1e09f3c5614..41e801b53064 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -1160,9 +1160,11 @@ static int __mmu_unsync_walk(struct kvm_mmu_page *sp, | |||
1160 | return -ENOSPC; | 1160 | return -ENOSPC; |
1161 | 1161 | ||
1162 | ret = __mmu_unsync_walk(child, pvec); | 1162 | ret = __mmu_unsync_walk(child, pvec); |
1163 | if (!ret) | 1163 | if (!ret) { |
1164 | __clear_bit(i, sp->unsync_child_bitmap); | 1164 | __clear_bit(i, sp->unsync_child_bitmap); |
1165 | else if (ret > 0) | 1165 | sp->unsync_children--; |
1166 | WARN_ON((int)sp->unsync_children < 0); | ||
1167 | } else if (ret > 0) | ||
1166 | nr_unsync_leaf += ret; | 1168 | nr_unsync_leaf += ret; |
1167 | else | 1169 | else |
1168 | return ret; | 1170 | return ret; |
@@ -1176,8 +1178,6 @@ static int __mmu_unsync_walk(struct kvm_mmu_page *sp, | |||
1176 | } | 1178 | } |
1177 | } | 1179 | } |
1178 | 1180 | ||
1179 | if (find_first_bit(sp->unsync_child_bitmap, 512) == 512) | ||
1180 | sp->unsync_children = 0; | ||
1181 | 1181 | ||
1182 | return nr_unsync_leaf; | 1182 | return nr_unsync_leaf; |
1183 | } | 1183 | } |