From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f174.google.com (mail-ig0-f174.google.com [209.85.213.174]) by kanga.kvack.org (Postfix) with ESMTP id 209086B0253 for ; Mon, 18 Jan 2016 05:09:01 -0500 (EST) Received: by mail-ig0-f174.google.com with SMTP id mw1so45554719igb.1 for ; Mon, 18 Jan 2016 02:09:01 -0800 (PST) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com. [2607:f8b0:4001:c06::22c]) by mx.google.com with ESMTPS id om7si25413277igb.3.2016.01.18.02.09.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jan 2016 02:09:00 -0800 (PST) Received: by mail-io0-x22c.google.com with SMTP id g73so352343797ioe.3 for ; Mon, 18 Jan 2016 02:09:00 -0800 (PST) MIME-Version: 1.0 Date: Mon, 18 Jan 2016 11:09:00 +0100 Message-ID: Subject: BUILD_BUG() in smaps_account() (was: Re: [PATCHv12 01/37] mm, proc: adjust PSS calculation) From: Geert Uytterhoeven Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: "Kirill A. Shutemov" Cc: Andrew Morton , Andrea Arcangeli , Hugh Dickins , Dave Hansen , Mel Gorman , Rik van Riel , Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Steve Capper , "Aneesh Kumar K.V" , Johannes Weiner , Michal Hocko , Jerome Marchand , Sasha Levin , "linux-kernel@vger.kernel.org" , Linux MM Hi Kirill, On Tue, Oct 6, 2015 at 5:23 PM, Kirill A. Shutemov wrote: > With new refcounting all subpages of the compound page are not necessary > have the same mapcount. We need to take into account mapcount of every > sub-page. > > Signed-off-by: Kirill A. Shutemov > Tested-by: Sasha Levin > Tested-by: Aneesh Kumar K.V > Acked-by: Jerome Marchand > Acked-by: Vlastimil Babka > --- > fs/proc/task_mmu.c | 47 +++++++++++++++++++++++++++++++---------------- > 1 file changed, 31 insertions(+), 16 deletions(-) > > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c > index bd167675a06f..ace02a4a07db 100644 > --- a/fs/proc/task_mmu.c > +++ b/fs/proc/task_mmu.c > @@ -454,9 +454,10 @@ struct mem_size_stats { > }; > > static void smaps_account(struct mem_size_stats *mss, struct page *page, > - unsigned long size, bool young, bool dirty) > + bool compound, bool young, bool dirty) > { > - int mapcount; > + int i, nr = compound ? HPAGE_PMD_NR : 1; If CONFIG_TRANSPARENT_HUGEPAGE is not set, we have: #define HPAGE_PMD_NR (1< email@kvack.org