From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752600AbcBOQle (ORCPT ); Mon, 15 Feb 2016 11:41:34 -0500 Received: from e06smtp05.uk.ibm.com ([195.75.94.101]:33336 "EHLO e06smtp05.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751351AbcBOQla (ORCPT ); Mon, 15 Feb 2016 11:41:30 -0500 X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: gerald.schaefer@de.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org;linux-s390@vger.kernel.org Date: Mon, 15 Feb 2016 17:41:19 +0100 From: Gerald Schaefer To: "Kirill A. Shutemov" Cc: Andrea Arcangeli , Christian Borntraeger , "Kirill A. Shutemov" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Aneesh Kumar K.V" , Andrew Morton , Linus Torvalds , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, Martin Schwidefsky , Heiko Carstens , linux-s390@vger.kernel.org, Sebastian Ott Subject: Re: [BUG] random kernel crashes after THP rework on s390 (maybe also on PowerPC and ARM) Message-ID: <20160215174119.53b56b86@thinkpad> In-Reply-To: <20160212231510.GB15142@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> <20160212231510.GB15142@node.shutemov.name> Organization: IBM Deutschland Research & Development GmbH / Vorsitzende des Aufsichtsrats: Martina Koederitz / Geschaeftsfuehrung: Dirk Wittkopp / Sitz der Gesellschaft: Boeblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294 X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.23; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16021516-0021-0000-0000-000005CE34D5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 13 Feb 2016 01:15:10 +0200 "Kirill A. Shutemov" wrote: > > I'm trying to wrap my head around the issue and I don't think missing > serialization with gup_fast is the cause -- we just don't need it > anymore. > > Previously, __split_huge_page_splitting() required serialization against > gup_fast to make sure nobody can obtain new reference to the page after > __split_huge_page_splitting() returns. This was a way to stabilize page > references before starting to distribute them from head page to tail > pages. > > With new refcounting, we don't care about this. Splitting PMD is now > decoupled from splitting underlying compound page. It's okay to get new > pins after split_huge_pmd(). To stabilize page references during > split_huge_page() we rely on setting up migration entries once all > pmds are split into page table entries. > > The theory that serialization against gup_fast is not a root cause of the > crashes is consistent no crashes on arm64. Problem is somewhere else. Hmm, ok, I just relied on the commit message of commit fecffad25458, which talks about "pmdp_clear_flush() will do IPI as needed for fast_gup", as well as the comments in mm/gup.c, which also still talk about IPIs and THP splitting. If IPI serialization with fast_gup is not needed anymore for THP splitting, please fix at least the comments in mm/gup.c. > > > > (It also does some some other magic to the attach_count, which might hold off > > > finish_arch_post_lock_switch while some flushing is happening, but this should > > > be unrelated here) > > > > > > > > > > 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 :-) > > One bit was freed up by the commit you've pointed to as a cause. > I wounder If it's possible that screw up something while removing it? I > don't see it, but who knows. > > Could you check if revert of fecffad25458 helps? I tried reverting fecffad25458, plus re-adding a call to pmdp_splitting_flush() in __split_huge_pmd_locked(), and I could still reproduce the crashes, so I guess it really isn't related to fast_gup vs. THP splitting. > > And could you share how crashes looks like? I haven't seen backtraces yet. > > > 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. >