2013-06-17 08:07:46

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: manual merge of the akpm tree with the kvm tree

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);


Attachments:
(No filename) (1.47 kB)
(No filename) (836.00 B)
Download all attachments

2013-06-17 12:24:07

by Xiao Guangrong

[permalink] [raw]
Subject: Re: linux-next: manual merge of the akpm tree with the kvm tree

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?

2013-06-18 00:16:29

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: manual merge of the akpm tree with the kvm tree

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]


Attachments:
(No filename) (545.00 B)
(No filename) (836.00 B)
Download all attachments