Hi Andrew,
Today's linux-next merge of the akpm tree got a conflict in
arch/x86/kvm/mmu.c between commit 365c886860c4 ("KVM: MMU: reclaim the
zapped-obsolete page first") from the kvm tree and commit "shrinker:
convert remaining shrinkers to count/scan API" from the akpm tree.
I fixed it up (see below) and can carry the fix as necessary (no action
is required).
--
Cheers,
Stephen Rothwell [email protected]
diff --cc arch/x86/kvm/mmu.c
index 6941fa7,422493d..0000000
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@@ -4312,12 -4213,8 +4312,13 @@@ restart
spin_unlock(&kvm->mmu_lock);
}
+static bool kvm_has_zapped_obsolete_pages(struct kvm *kvm)
+{
+ return unlikely(!list_empty_careful(&kvm->arch.zapped_obsolete_pages));
+}
+
- static int mmu_shrink(struct shrinker *shrink, struct shrink_control *sc)
+ static long
+ mmu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
{
struct kvm *kvm;
int nr_to_scan = sc->nr_to_scan;
@@@ -4352,16 -4246,9 +4351,16 @@@
idx = srcu_read_lock(&kvm->srcu);
spin_lock(&kvm->mmu_lock);
+ if (kvm_has_zapped_obsolete_pages(kvm)) {
+ kvm_mmu_commit_zap_page(kvm,
+ &kvm->arch.zapped_obsolete_pages);
+ goto unlock;
+ }
+
- prepare_zap_oldest_mmu_page(kvm, &invalid_list);
+ freed += prepare_zap_oldest_mmu_page(kvm, &invalid_list);
kvm_mmu_commit_zap_page(kvm, &invalid_list);
+unlock:
spin_unlock(&kvm->mmu_lock);
srcu_read_unlock(&kvm->srcu, idx);
Hi Stephen,
Thanks for your work!
On 06/17/2013 04:07 PM, Stephen Rothwell wrote:
> - prepare_zap_oldest_mmu_page(kvm, &invalid_list);
> + freed += prepare_zap_oldest_mmu_page(kvm, &invalid_list);
It seems this change is not needed? and "freed" is not defined in mmu_shrink().
Right?
Hi Xiao,
On Mon, 17 Jun 2013 20:23:48 +0800 Xiao Guangrong <[email protected]> wrote:
>
> On 06/17/2013 04:07 PM, Stephen Rothwell wrote:
>
> > - prepare_zap_oldest_mmu_page(kvm, &invalid_list);
> > + freed += prepare_zap_oldest_mmu_page(kvm, &invalid_list);
>
> It seems this change is not needed? and "freed" is not defined in mmu_shrink().
> Right?
That same patch in the akpm tree renames "mmu_shrink" to
"mmu_shrink_scan" and declares "freed" ...
--
Cheers,
Stephen Rothwell [email protected]