From patchwork Tue Feb 23 10:32:21 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: 8390271 Return-Path: X-Original-To: patchwork-linux-arm@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 7A42BC0554 for ; Tue, 23 Feb 2016 10:35:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7ED2C20384 for ; Tue, 23 Feb 2016 10:35:24 +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 1828520394 for ; Tue, 23 Feb 2016 10:35:21 +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 1aYAHz-00079p-EU; Tue, 23 Feb 2016 10:33:55 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYAGs-0006Jf-2N for linux-arm-kernel@lists.infradead.org; Tue, 23 Feb 2016 10:32:47 +0000 Received: by mail-wm0-x22a.google.com with SMTP id b205so193151286wmb.1 for ; Tue, 23 Feb 2016 02:32:24 -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-disposition:in-reply-to:user-agent; bh=4T1X+lfUZNCSAUbwz4KTlgxQ8XbMviQBEtaufDFSeUM=; b=IbMK20sporLgiBnqgxhjJ8rSIaCdgEm7lJnf1u8B5559dWH9ZyQVeSpaROp2SbppVm Q+83gxT6v1RgAZtHaadJ5dSD92vq54BxHl21bEc5s9CFOpB5SKr58z8KW0KqQM6aW4Ca uKwbJ4Tcaj95qtVDiABWYgaMxpfPNO/bXsIDoqysD0gfAqhp3apTs0QUWOyRdDgbxy/f mkloTbz1TTS4/ql1F0FyX4FZ2/uX+apjL/gPUfswRlBVGSp3f2K4xuUmMkVVYOvOaay2 XaJZNuiREChp9oSCQpJ1uIHPL3lA6kId3BrCHr6iZPcUjr5PYvC+0+RUaJfgZO4dpUWk ls0A== 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-disposition:in-reply-to:user-agent; bh=4T1X+lfUZNCSAUbwz4KTlgxQ8XbMviQBEtaufDFSeUM=; b=FSGgB//3fOW0Tzg41nCV6R6PK/guVlcaJPqoGPARjJed02xE5me9H7Op2c7eZCd13c 99/7rLmugX1JHsMmRRcQI60rscMy/VZJCJNG3kX/rGHHxU/EEcs48qFYLKPRjK42uH6Y WVy7o/FDM5MDpjV2Nyfb+6aZq1kj0LI6gTVZXUpDlktnTTU+OxtZcoqZOGGOSUqB7vNX QkYMwd7bKAsCDMHSu8seZ1VItzlbA7++Px4iNeajcRX4kCjgbUuy/4v6QFRZ425ji5J1 zwwTZtWlwIZ386R6Kf4uBrhoxvwLIVxkIqlmLVxWIH6m2Rwvm8mNyn043glzCRPcgb0Q 2+sA== X-Gm-Message-State: AG10YOQcvUNwTtVzYXZlndm3h3ZkjZDaa35rQlGYGvHuAUtJW3158b8GPiOtQNtvOBhxPg== X-Received: by 10.28.194.136 with SMTP id s130mr18174955wmf.23.1456223543180; Tue, 23 Feb 2016 02:32:23 -0800 (PST) Received: from node.shutemov.name ([93.85.13.197]) by smtp.gmail.com with ESMTPSA id y3sm25481285wmy.17.2016.02.23.02.32.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Feb 2016 02:32:22 -0800 (PST) Received: by node.shutemov.name (Postfix, from userid 1000) id 11F476197AE5; Tue, 23 Feb 2016 13:32:21 +0300 (MSK) Date: Tue, 23 Feb 2016 13:32:21 +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: <20160223103221.GA1418@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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160212181640.4eabb85f@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_023246_418273_50752EA3 X-CRM114-Status: GOOD ( 18.58 ) 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 Fri, Feb 12, 2016 at 06:16:40PM +0100, Gerald Schaefer wrote: > On Fri, 12 Feb 2016 16:57:27 +0100 > Christian Borntraeger wrote: > > > > I'm also confused by pmd_none() is equal to !pmd_present() on s390. Hm? > > > > Don't know, Gerald or Martin? > > The implementation frequently changes depending on how many new bits Martin > needs to squeeze out :-) > We don't have a _PAGE_PRESENT bit for pmds, so pmd_present() just checks if the > entry is not empty. pmd_none() of course does the opposite, it checks if it is > empty. I still worry about pmd_present(). It looks wrong to me. I wounder if patch below makes a difference. The theory is that the splitting bit effetely masked bogus pmd_present(): we had pmd_trans_splitting() in all code path and that prevented mm from touching the pmd. Once pmd_trans_splitting() has gone, mm proceed with the pmd where it shouldn't and here's a boom. I'm not sure that the patch is correct wrt yound/old pmds and I have no way to test it... diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 64ead8091248..2eeb17ab68ac 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@ -490,7 +490,7 @@ static inline int pud_bad(pud_t pud) static inline int pmd_present(pmd_t pmd) { - return pmd_val(pmd) != _SEGMENT_ENTRY_INVALID; + return !(pmd_val(pmd) & _SEGMENT_ENTRY_INVALID); } static inline int pmd_none(pmd_t pmd)