Re: [PATCHv5 03/28] memcg: adjust to support new THP refcounting

2015-05-16 Thread Kirill A. Shutemov
On Fri, May 15, 2015 at 07:57:39AM -0700, Dave Hansen wrote: > On 05/15/2015 04:18 AM, Kirill A. Shutemov wrote: > >> > But same question about whether it should be using hpage_nr_pages() > >> > instead > >> > of a constant. > > No. Compiler woundn't be able to optimize HPAGE_PMD_NR away for THP=n

Re: [PATCHv5 03/28] memcg: adjust to support new THP refcounting

2015-05-15 Thread Dave Hansen
On 05/15/2015 04:18 AM, Kirill A. Shutemov wrote: >> > But same question about whether it should be using hpage_nr_pages() instead >> > of a constant. > No. Compiler woundn't be able to optimize HPAGE_PMD_NR away for THP=n, > since compound value cross compilation unit barrier. What code are you t

Re: [PATCHv5 03/28] memcg: adjust to support new THP refcounting

2015-05-15 Thread Kirill A. Shutemov
On Fri, May 15, 2015 at 09:44:17AM +0200, Vlastimil Babka wrote: > On 04/23/2015 11:03 PM, Kirill A. Shutemov wrote: > >As with rmap, with new refcounting we cannot rely on PageTransHuge() to > >check if we need to charge size of huge page form the cgroup. We need to > >get information from caller

Re: [PATCHv5 03/28] memcg: adjust to support new THP refcounting

2015-05-15 Thread Vlastimil Babka
On 04/23/2015 11:03 PM, Kirill A. Shutemov wrote: As with rmap, with new refcounting we cannot rely on PageTransHuge() to check if we need to charge size of huge page form the cgroup. We need to get information from caller to know whether it was mapped with PMD or PTE. We do uncharge when last r

[PATCHv5 03/28] memcg: adjust to support new THP refcounting

2015-04-23 Thread Kirill A. Shutemov
As with rmap, with new refcounting we cannot rely on PageTransHuge() to check if we need to charge size of huge page form the cgroup. We need to get information from caller to know whether it was mapped with PMD or PTE. We do uncharge when last reference on the page gone. At that point if we see P