From patchwork Thu Mar 12 22:07:56 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: 5999961 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 063CABF90F for ; Thu, 12 Mar 2015 22:08:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A80E2035B for ; Thu, 12 Mar 2015 22:08:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 344E02035D for ; Thu, 12 Mar 2015 22:08:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753493AbbCLWIH (ORCPT ); Thu, 12 Mar 2015 18:08:07 -0400 Received: from mta-out1.inet.fi ([62.71.2.195]:51536 "EHLO jenni2.inet.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752179AbbCLWIH (ORCPT ); Thu, 12 Mar 2015 18:08:07 -0400 Received: from node.shutemov.name (80.220.224.16) by jenni2.inet.fi (8.5.142.08) id 54E3C70702E190D6; Fri, 13 Mar 2015 00:07:57 +0200 Received: by node.shutemov.name (Postfix, from userid 1000) id 53CC241372; Fri, 13 Mar 2015 00:07:56 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shutemov.name; s=default; t=1426198076; bh=durXnk51NqSbe8s9wK8Pup0biz4oA0dUJ071vVL1tUg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=MtJC7jRLBiAwp2dhTbOJbBRrnkK9Je70Q3t2234NHAmYo29VOeqZCe4EQlM7TEOaM sViJoi3vEw55dXtaxAGKoA1Kl3zuCr0w9UPzeBwgPkg3Fw9HnE3gl+tVnHi9jLwWak VGB6LwIc/sxOgsQXLJ2SoomAB1IBb7p5RCSHTVis= Date: Fri, 13 Mar 2015 00:07:56 +0200 From: "Kirill A. Shutemov" To: John David Anglin Cc: Aaro Koskinen , Graham Gower , Domenico Andreoli , linux-parisc List Subject: Re: BUG: non-zero nr_pmds on freeing mm: -1 Message-ID: <20150312220756.GA4792@node.dhcp.inet.fi> References: <20150312193556.GE587@fuloong-minipc.musicnaut.iki.fi> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham 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 On Thu, Mar 12, 2015 at 03:51:11PM -0400, John David Anglin wrote: > On 2015-03-12 3:35 PM, Aaro Koskinen wrote: > >Hi, > > > >On Wed, Mar 11, 2015 at 08:21:35PM -0400, John David Anglin wrote: > >>On 2015-03-11, at 7:31 PM, Graham Gower wrote: > >>>I thought this patch was supposed to address the problem? > >>>https://lkml.org/lkml/2015/2/26/230 > >>> > >>>However, its not fixed it for me either in 4.0.0-rc3. > >>I doubt the patch is correct for parisc. I believe the system where > >>I saw the BUG messages has PT_NLEVELS == 3. > >For 32-bit kernels, the fix helped. > 32-bit kernels have PT_NLEVELS == 2. I think the define needs to be moved > outside #if/#endif > but didn't get a chance to test last night. There's hack in pgd_alloc() on parisc to initialize one pmd, which is not accounted and we get underflow on exit. We need to adjust accounting for that pmd. Could you try the patch below? diff --git a/arch/parisc/include/asm/pgalloc.h b/arch/parisc/include/asm/pgalloc.h index f213f5b4c423..8ee9a0bdc468 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;