From patchwork Tue Feb 23 19:33:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A. Shutemov" X-Patchwork-Id: 8395691 Return-Path: X-Original-To: patchwork-linux-arm@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 E07DF9F52D for ; Tue, 23 Feb 2016 19:35:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D0913202EB for ; Tue, 23 Feb 2016 19:35:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2ABD20265 for ; Tue, 23 Feb 2016 19:35:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYIiq-0006ax-Oo; Tue, 23 Feb 2016 19:34:12 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYIin-0006PC-GM for linux-arm-kernel@lists.infradead.org; Tue, 23 Feb 2016 19:34:10 +0000 Received: by mail-wm0-x236.google.com with SMTP id g62so239050840wme.1 for ; Tue, 23 Feb 2016 11:33:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=CU/WeNL82OmN+fMZC/Z7cBAY2U2YYv4bUkPKYgNvid8=; b=alKeSruzf+wsuTBS3BZuJyHzH3+MT1iXZWZwzXDljZ3DU2grqHZFIDX9FOQO9Z7/fQ Z+4F+U5k+7sikVATxpD1r5TBYjJ9blVsSLWxBxrtqxIhKfTqIwwjW6I2QzFdREfvZY1D zBsyLdN09cj56jsuB9rCtehNWc37nCPVNIhEvAQo4bkbsUzxq1Gm5/3JS3ylRKMKVS0S JpWjH/8aXk5se15Vk2xBqnSNbK3/X1fVQ7+VllSycB3YPDddPK261XZu4wXvCbhXkx2S Orfa8fsJ4KFAICXQMTue7D9h1+SVXbjzqkcIgeL1tKUiXnnp20/pVYVY1uGP/MRe3sMY sBJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=CU/WeNL82OmN+fMZC/Z7cBAY2U2YYv4bUkPKYgNvid8=; b=cY8ZTww+7A4FAYPKAhgRVza1mwNfghT2I9n/QreFync6XyQ2ZLQGpILAlRGbj2OfWX iYOM6kGhmxvRWHpLhkWZxom84jrT5dYO/3p6GLLoThlLtL5axO2SRDaIT+xKa5nItWeB ODkvasWHkTMoGvresO4URtB8Gc1cgJdr0k01vqJ8T1DDylpbmaNU5lZoprRrHiEnCi0W YZVmIg6BxeilRVsnC6H1GeSgW9tD2G6r6ij1ovkEt5vvayxbubtnYc2gcgWb2BsGV3UY rCe/VwB8JT3wT6ArxeKyrO0nKxvmmyfV4rBCDgZ+nWGJK6M2EhItyMnT+qQ+VUxiUhYB qJ/g== X-Gm-Message-State: AG10YOTlnjrJoCXXXnlJEWTK4RBTtGV+I4ii5c9PNjMZaM3QIkFl23eW29thxZVt2FrAKQ== X-Received: by 10.28.54.197 with SMTP id y66mr19151162wmh.16.1456256027881; Tue, 23 Feb 2016 11:33:47 -0800 (PST) Received: from node.shutemov.name ([93.85.13.197]) by smtp.gmail.com with ESMTPSA id p125sm27680160wmd.16.2016.02.23.11.33.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Feb 2016 11:33:47 -0800 (PST) Received: by node.shutemov.name (Postfix, from userid 1000) id E7E8C6197AF8; Tue, 23 Feb 2016 22:33:45 +0300 (MSK) Date: Tue, 23 Feb 2016 22:33:45 +0300 From: "Kirill A. Shutemov" To: Gerald Schaefer Subject: Re: [BUG] random kernel crashes after THP rework on s390 (maybe also on PowerPC and ARM) Message-ID: <20160223193345.GC21820@node.shutemov.name> References: <20160211192223.4b517057@thinkpad> <20160211190942.GA10244@node.shutemov.name> <20160211205702.24f0d17a@thinkpad> <20160212154116.GA15142@node.shutemov.name> <56BE00E7.1010303@de.ibm.com> <20160212181640.4eabb85f@thinkpad> <20160223103221.GA1418@node.shutemov.name> <20160223191907.25719a4d@thinkpad> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160223191907.25719a4d@thinkpad> User-Agent: Mutt/1.5.23.1 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160223_113409_702661_5C3302B3 X-CRM114-Status: GOOD ( 15.01 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, Catalin Marinas , Heiko Carstens , linux-mm@kvack.org, Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Will Deacon , linux-kernel@vger.kernel.org, Christian Borntraeger , Paul Mackerras , "Aneesh Kumar K.V" , Benjamin Herrenschmidt , Martin Schwidefsky , Andrew Morton , Linus Torvalds , "Kirill A. Shutemov" , Sebastian Ott Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Tue, Feb 23, 2016 at 07:19:07PM +0100, Gerald Schaefer wrote: > I'll check with Martin, maybe it is actually trivial, then we can > do a quick test it to rule that one out. Oh. I found a bug in __split_huge_pmd_locked(). Although, not sure if it's _the_ bug. pmdp_invalidate() is called for the wrong address :-/ I guess that can be destructive on the architecture, right? Could you check this? diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 1c317b85ea7d..4246bc70e55a 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2865,7 +2865,7 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd, pgtable = pgtable_trans_huge_withdraw(mm, pmd); pmd_populate(mm, &_pmd, pgtable); - for (i = 0; i < HPAGE_PMD_NR; i++, haddr += PAGE_SIZE) { + for (i = 0; i < HPAGE_PMD_NR; i++) { pte_t entry, *pte; /* * Note that NUMA hinting access restrictions are not @@ -2886,9 +2886,9 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd, } if (dirty) SetPageDirty(page + i); - pte = pte_offset_map(&_pmd, haddr); + pte = pte_offset_map(&_pmd, haddr + i * PAGE_SIZE); BUG_ON(!pte_none(*pte)); - set_pte_at(mm, haddr, pte, entry); + set_pte_at(mm, haddr + i * PAGE_SIZE, pte, entry); atomic_inc(&page[i]._mapcount); pte_unmap(pte); } @@ -2938,7 +2938,7 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd, pmd_populate(mm, pmd, pgtable); if (freeze) { - for (i = 0; i < HPAGE_PMD_NR; i++, haddr += PAGE_SIZE) { + for (i = 0; i < HPAGE_PMD_NR; i++) { page_remove_rmap(page + i, false); put_page(page + i); }