From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DE52C55178 for ; Mon, 26 Oct 2020 13:14:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D80C82080A for ; Mon, 26 Oct 2020 13:14:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="p3vct6D2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D80C82080A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 407076B005C; Mon, 26 Oct 2020 09:14:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 390CD6B006C; Mon, 26 Oct 2020 09:14:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2577D6B006E; Mon, 26 Oct 2020 09:14:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0123.hostedemail.com [216.40.44.123]) by kanga.kvack.org (Postfix) with ESMTP id E96E36B005C for ; Mon, 26 Oct 2020 09:14:09 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9D24E181AC9CB for ; Mon, 26 Oct 2020 13:14:08 +0000 (UTC) X-FDA: 77414119776.02.egg73_5e0ed7d27273 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 7DD2B10097AA1 for ; Mon, 26 Oct 2020 13:14:08 +0000 (UTC) X-HE-Tag: egg73_5e0ed7d27273 X-Filterd-Recvd-Size: 3897 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Mon, 26 Oct 2020 13:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=lta2H3+0F6XrQvumNGK2SyvRq8bs5VV2UbSLAwhlWGE=; b=p3vct6D2uTGzWeM0J29gXSW59P Z6fYSCZYhXh0jmldeAg2pwv82tIHgQj8ajZl5XmjJRSfxawBd6GKMI0wqaI08FmgIoie/EojZTMEx uABPSw22X3nZcq+0buG1zj0qm42j28oyNBAmWEHCd1lR29iqRsYcm4DkaskFSETEDMNIDRHFpX2bA m32PRa9MPYqUMrkjsw0m0m+c+3KQ0ErG0bhBM8q0cGUtP0P1CITvKJmkUGeGSEJ7dEyl1SIH4w2ye SOyw39zOAAnEpj8qYS7HmLsuVxKxps235DF6V/0Gu03ETPRaEunyWlc1oRdrTSTeORAjJp/Ay4awP wF9ysFdQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kX2Jt-00066K-9f; Mon, 26 Oct 2020 13:13:53 +0000 Date: Mon, 26 Oct 2020 13:13:53 +0000 From: Matthew Wilcox To: Jan Kara Cc: Qian Cai , Christoph Hellwig , "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe , linux-mm@kvack.org Subject: Re: kernel BUG at mm/page-writeback.c:2241 [ BUG_ON(PageWriteback(page); ] Message-ID: <20201026131353.GP20115@casper.infradead.org> References: <645a3f332f37e09057c10bc32f4f298ce56049bb.camel@lca.pw> <20201022004906.GQ20115@casper.infradead.org> <20201026094948.GA29758@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201026094948.GA29758@quack2.suse.cz> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Oct 26, 2020 at 10:49:48AM +0100, Jan Kara wrote: > On Thu 22-10-20 01:49:06, Matthew Wilcox wrote: > > On Wed, Oct 21, 2020 at 08:30:18PM -0400, Qian Cai wrote: > > > Today's linux-next starts to trigger this wondering if anyone has any clue. > > > > I've seen that occasionally too. I changed that BUG_ON to VM_BUG_ON_PAGE > > to try to get a clue about it. Good to know it's not the THP patches > > since they aren't in linux-next. > > > > I don't understand how it can happen. We have the page locked, and then we do: > > > > if (PageWriteback(page)) { > > if (wbc->sync_mode != WB_SYNC_NONE) > > wait_on_page_writeback(page); > > else > > goto continue_unlock; > > } > > > > VM_BUG_ON_PAGE(PageWriteback(page), page); > > > > Nobody should be able to put this page under writeback while we have it > > locked ... right? The page can be redirtied by the code that's supposed > > to be writing it back, but I don't see how anyone can make PageWriteback > > true while we're holding the page lock. > > FWIW here's very similar report for ext4 [1] and I strongly suspect this > started happening after Linus' rewrite of the page bit waiting logic. Linus > thinks it's preexisting bug which just got exposed by his changes (which is > possible). I've been searching a culprit for some time but so far I failed. > It's good to know it isn't ext4 specific so we should be searching in the > generic code ;). So far I was concentrating more on ext4 bits... > > Honza > > [1] https://lore.kernel.org/lkml/000000000000d3a33205add2f7b2@google.com/ Oh good, I was wondering if it was an XFS bug ;-) I hope Qian gets it to reproduce soon with the assert because that will tell us whether it's a spurious wakeup or someone calling SetPageWriteback without holding the page lock.