From patchwork Fri Mar 13 10:30:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A. Shutemov" X-Patchwork-Id: 6004131 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A2CF79F318 for ; Fri, 13 Mar 2015 10:30:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D57C52021A for ; Fri, 13 Mar 2015 10:30:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A92F2011B for ; Fri, 13 Mar 2015 10:30:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754696AbbCMKaN (ORCPT ); Fri, 13 Mar 2015 06:30:13 -0400 Received: from mga11.intel.com ([192.55.52.93]:46207 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754692AbbCMKaK (ORCPT ); Fri, 13 Mar 2015 06:30:10 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 13 Mar 2015 03:30:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,394,1422950400"; d="scan'208";a="466763823" Received: from black.fi.intel.com ([10.237.72.86]) by FMSMGA003.fm.intel.com with ESMTP; 13 Mar 2015 03:23:12 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 90F3D4A8; Fri, 13 Mar 2015 12:30:06 +0200 (EET) From: "Kirill A. Shutemov" To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, "Kirill A. Shutemov" , John David Anglin , Aaro Koskinen , Graham Gower , Domenico Andreoli Subject: [PATCH] parisc: fix pmd accounting with 3-level page tables Date: Fri, 13 Mar 2015 12:30:02 +0200 Message-Id: <1426242602-52804-1-git-send-email-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.1.4 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There's hack in pgd_alloc() on parisc to initialize one pmd, which is not accounted. It leads to underflow on exit. Let's adjust nr_pmds on pgd_alloc() to get accounting correct. Signed-off-by: Kirill A. Shutemov Cc: John David Anglin Cc: Aaro Koskinen Cc: Graham Gower Cc: Domenico Andreoli Tested-by: graham.gower@gmail.com --- arch/parisc/include/asm/pgalloc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/parisc/include/asm/pgalloc.h b/arch/parisc/include/asm/pgalloc.h index 55ad8be9b7f3..068b2fb9a47c 100644 --- a/arch/parisc/include/asm/pgalloc.h +++ b/arch/parisc/include/asm/pgalloc.h @@ -38,6 +38,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) /* The first pmd entry also is marked with _PAGE_GATEWAY as * a signal that this pmd may not be freed */ __pgd_val_set(*pgd, PxD_FLAG_ATTACHED); + mm_inc_nr_pmds(mm); #endif } return actual_pgd;