lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Jun 2010 11:23:25 +0300
From:	Avi Kivity <avi@...hat.com>
To:	Dave Hansen <dave@...ux.vnet.ibm.com>
CC:	linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Subject: Re: [RFC][PATCH 4/9] create aggregate kvm_total_used_mmu_pages value

On 06/16/2010 07:55 PM, Dave Hansen wrote:
> On Wed, 2010-06-16 at 11:48 +0300, Avi Kivity 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.
>>      
> We do have the stuff in:
>
> 	include/linux/percpu_counter.h
>
> the downside being that they're not precise and they're *HUGE* according
> to the comment. :)
>
> It's actually fairly difficult to do a counter which is precise,
> scalable, and works well for small CPU counts when NR_CPUS is large.  Do
> you mind if we just stick with a plain atomic_t for now?
>    

Do we really need something precise?

I'm not excited by adding a global atomic.  So far nothing in the kvm 
hot paths depends on global shared memory (though we have lots of per-vm 
shared memory).

Can we perhaps query the kmem_cache for a representation of the amount 
of objects?

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ