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: 586804 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D1A2E1409A0 for ; Tue, 23 Feb 2016 21:33:55 +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=IbMK20sp; 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 AF2C01A0609 for ; Tue, 23 Feb 2016 21:33:55 +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=IbMK20sp; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (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 012DB1A0518 for ; Tue, 23 Feb 2016 21:32:26 +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=IbMK20sp; dkim-atps=neutral Received: by mail-wm0-x236.google.com with SMTP id g62so203245833wme.0 for ; Tue, 23 Feb 2016 02:32:26 -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=PZYyuFTo42LFw2kk45EGXGLEu1jFp3doF0blD02XQV4OpnYdxvAD37MQkPQVXdmIXB MNI0EPVT+eU+sQFUNK57uHWL3xEFU47me44OjKFBdLhCXmiGDLXlGBV5P6hSvfnn7RJN 9tAHBtSi4DIs7nT/jmpIjDXYQsO6qUASwY/NwWPEF6ma2L7zloF0YaPPn2qrYKGjTxRG 4EgAVfa2rFVeaokZWinE3wshgAsQUIE3/F3BuW4HN9aHQS/RH9cpLvT6d1lhfnRV6M33 zd+mEZx4r9RffuIETtVkpacjl9BGiQaXrheaK1DI+LfVVgKoBuGBVusNzuqv22bqy//r 8NIA== X-Gm-Message-State: AG10YOQY7fd4jBUGCAVSlxK5NyXh+hbyRqHEIBvl/BoIW5rj9det6CeCtsU2me5gKWn7qQ== 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-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 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)