Re: [RFC][PATCH 4/9] create aggregate kvm_total_used_mmu_pages value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/16/2010 06:06 PM, Dave Hansen wrote:


+static inline void kvm_mod_used_mmu_pages(struct kvm *kvm, int nr)
+{
+	kvm->arch.n_used_mmu_pages += nr;
+	kvm_total_used_mmu_pages += nr;

Needs an atomic operation, since there's no global lock here.  To avoid
bouncing this cacheline around, make the variable percpu and make
readers take a sum across all cpus.  Side benefit is that you no longer
need an atomic but a local_t, which is considerably cheaper.
That's a good point.  All of the modifications are done under locks, but
the fast path isn't any more.  I'll fix it up.


Note, even before you moved the shrinker out of the lock, this was a problem. kvm_mod_used_mmu_pages() is called not just from the shrinker code, we zap pages for other reasons as well.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux