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

From: Kirill A. Shutemov
Date: Sat May 16 2015 - 19:18:36 EST


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,
> > since compound value cross compilation unit barrier.
>
> What code are you talking about here, specifically? This?
>
> static inline int hpage_nr_pages(struct page *page)
> {
> if (unlikely(PageTransHuge(page)))
> return HPAGE_PMD_NR;
> return 1;
> }

No. See for instance mem_cgroup_try_charge(). Vlastimil would like to
replace hpage_nr_pages() call with plain HPAGE_PMD_NR.

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