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: 587046 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 D59BB14018C for ; Wed, 24 Feb 2016 06:36:19 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b=alKeSruz; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id B0E7F1A0A51 for ; Wed, 24 Feb 2016 06:36:19 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b=alKeSruz; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id B1E741A0791 for ; Wed, 24 Feb 2016 06:33:52 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b=alKeSruz; dkim-atps=neutral Received: by mail-wm0-x230.google.com with SMTP id g62so239050986wme.1 for ; Tue, 23 Feb 2016 11:33:52 -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=RYvvZ6e4J5HQH3XS2y6aMGI37WeYU0Zu+t6BfTIZI5qOXDH3g6ytsQLELuB78+MaER 5NhT0HB73ZzJwLlW4w80Md7N9jxPY9ETutwN3NeK016+ZmmnjLTrhZvhnYGfHMqKx/1j Fu/4Whm5nwo96OgpyEVjzuWSK+s67FlbtwRvbBDtb9AJCdZBPB18zQV93ZX6Ex71glaG lgwaTe1AUTwkQWq+NzHgQb5C9O61nE/PlrwC2A2IR37h8YhcN9jHkt9sowgWtJjm2yWj l7/copaU4lhmbXp0SZ+JshhWHILdE+PyvqSex+M+eh9IAE0ulIMpIYz9k7lwouD10Szi Ye/Q== X-Gm-Message-State: AG10YOQ4pnugAwV4rIOKhvz/o4LzPjgMU3DpGgBZ5z9QeymY4YWikRXbAampcR89XSI9HQ== 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-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List 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, linuxppc-dev@lists.ozlabs.org, Will Deacon , linux-kernel@vger.kernel.org, Christian Borntraeger , Paul Mackerras , "Aneesh Kumar K.V" , Martin Schwidefsky , Andrew Morton , Linus Torvalds , "Kirill A. Shutemov" , Sebastian Ott Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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); }