From patchwork Sat Apr 11 00:45:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Wood X-Patchwork-Id: 460281 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 367B31402F9 for ; Sat, 11 Apr 2015 10:46:17 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 19B4B1A0CD8 for ; Sat, 11 Apr 2015 10:46:17 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bn0108.outbound.protection.outlook.com [157.56.110.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 1BCD51A03C8 for ; Sat, 11 Apr 2015 10:45:20 +1000 (AEST) Received: from snotra.am.freescale.net (192.88.168.49) by BLUPR03MB1475.namprd03.prod.outlook.com (0.163.81.17) with Microsoft SMTP Server (TLS) id 15.1.130.23; Sat, 11 Apr 2015 00:45:13 +0000 From: Scott Wood To: Benjamin Herrenschmidt , Michael Ellerman Subject: [PATCH] powerpc/hugetlb: Call mm_dec_nr_pmds() in hugetlb_free_pmd_range() Date: Fri, 10 Apr 2015 19:45:05 -0500 Message-ID: <1428713105-11796-1-git-send-email-scottwood@freescale.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 X-Originating-IP: [192.88.168.49] X-ClientProxiedBy: BLUPR08CA0049.namprd08.prod.outlook.com (10.141.200.29) To BLUPR03MB1475.namprd03.prod.outlook.com (25.163.81.17) Authentication-Results: kernel.crashing.org; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1475; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10019020)(6009001)(87976001)(36756003)(122386002)(77156002)(92566002)(50986999)(46102003)(19580405001)(50226001)(42186005)(47776003)(40100003)(33646002)(229853001)(19580395003)(62966003)(66066001)(50466002)(86362001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB1475; H:snotra.am.freescale.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002010); SRVR:BLUPR03MB1475; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB1475; X-Forefront-PRVS: 05437568AA X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2015 00:45:13.4080 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1475 Cc: Scott Wood , linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Commit dc6c9a35b66b5 ("mm: account pmd page tables to the process") added a counter that is incremented whenever a PMD is allocated and decremented whenever a PMD is freed. For hugepages on PPC, common code is used to allocated PMDs, but arch-specific code is used to free PMDs. This results in kernel output such as "BUG: non-zero nr_pmds on freeing mm: 1" when using hugepages. Update the PPC hugepage PMD freeing code to decrement the count, just as the above commit did for free_pmd_range(). Fixes: dc6c9a35b66b5 ("mm: account pmd page tables to the process") Signed-off-by: Scott Wood Reviewed-by: Aneesh Kumar K.V --- Should we also be touching nr_ptes when we alloc/free hugepage PTEs? arch/powerpc/mm/hugetlbpage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 7e408bf..cecbe00 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c @@ -581,6 +581,7 @@ static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud, pmd = pmd_offset(pud, start); pud_clear(pud); pmd_free_tlb(tlb, pmd, start); + mm_dec_nr_pmds(tlb->mm); } static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,