Re: [RFC PATCH] mm, kvm: account kvm_vcpu_mmap to kmemcg

2019-03-29 Thread Shakeel Butt
On Fri, Mar 29, 2019 at 12:52 AM Michal Hocko wrote: > > On Thu 28-03-19 18:28:36, Shakeel Butt wrote: > > A VCPU of a VM can allocate upto three pages which can be mmap'ed by the > > user space application. At the moment this memory is not charged. On a > > large machine running large number of V

Re: [RFC PATCH] mm, kvm: account kvm_vcpu_mmap to kmemcg

2019-03-29 Thread Johannes Weiner
On Thu, Mar 28, 2019 at 08:59:45PM -0700, Shakeel Butt wrote: > On Thu, Mar 28, 2019 at 7:36 PM Matthew Wilcox wrote: > > I don't understand why we need a PageKmemcg anyway. We already > > have an entire pointer in struct page; can we not just check whether > > page->mem_cgroup is NULL or not? >

Re: [RFC PATCH] mm, kvm: account kvm_vcpu_mmap to kmemcg

2019-03-29 Thread Michal Hocko
On Thu 28-03-19 18:28:36, Shakeel Butt wrote: > A VCPU of a VM can allocate upto three pages which can be mmap'ed by the > user space application. At the moment this memory is not charged. On a > large machine running large number of VMs (or small number of VMs having > large number of VCPUs), this

Re: [RFC PATCH] mm, kvm: account kvm_vcpu_mmap to kmemcg

2019-03-28 Thread Shakeel Butt
On Thu, Mar 28, 2019 at 7:36 PM Matthew Wilcox wrote: > > On Thu, Mar 28, 2019 at 06:28:36PM -0700, Shakeel Butt wrote: > > A VCPU of a VM can allocate upto three pages which can be mmap'ed by the > > user space application. At the moment this memory is not charged. On a > > large machine running

Re: [RFC PATCH] mm, kvm: account kvm_vcpu_mmap to kmemcg

2019-03-28 Thread Matthew Wilcox
On Thu, Mar 28, 2019 at 06:28:36PM -0700, Shakeel Butt wrote: > A VCPU of a VM can allocate upto three pages which can be mmap'ed by the > user space application. At the moment this memory is not charged. On a > large machine running large number of VMs (or small number of VMs having > large number

[RFC PATCH] mm, kvm: account kvm_vcpu_mmap to kmemcg

2019-03-28 Thread Shakeel Butt
A VCPU of a VM can allocate upto three pages which can be mmap'ed by the user space application. At the moment this memory is not charged. On a large machine running large number of VMs (or small number of VMs having large number of VCPUs), this unaccounted memory can be very significant. So, this