Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp357905pxx; Mon, 26 Oct 2020 10:05:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBmBt3lNtwxdggXI+8ZLelWHyFcMhjyr+S32L8B9XKR+IqeWRED+EIinojxqaAbLH5WevF X-Received: by 2002:a17:906:5e4f:: with SMTP id b15mr17002350eju.353.1603731949617; Mon, 26 Oct 2020 10:05:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603731949; cv=none; d=google.com; s=arc-20160816; b=J8Sng62Mc4cmQnZGUb/WGvbIRw8YxddCuIQ1SrtbhDdp8DlEAqSCQPieZpZFdvS8Oq sD4dBocrGjCo+wHCPqM6tTkBf1T9KxhxNTgUi0LeYKtoTwVwNcNJvuI31CL4eKu+ZTZ4 lpb7/2qGBagkrL7wXPIrkuxIxNZptdZ2apE5KiwANzSUgVB6tQRtNKxTNGh/VRHIYF6/ eNbR+ZFPbueK2zXTQTO6nVwxnhNhIeWmuMiTsaIGDqsOFc/RIytfhrgJBXHhRAkAzz6v h6jXkjuoA/ovEc2M8Ifg5wmPPzvKYMIbH3kO38uNvF/ZY7YqFD89+2DbGNH2dlyhBId7 UmKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lta2H3+0F6XrQvumNGK2SyvRq8bs5VV2UbSLAwhlWGE=; b=YFTyfQOOanHTtemarpvfLgWov8yZKkN5uEzKiurXlHUSFdvdcDKfEWqPZ8/k++VntN BwmPuO64EDgRxLOzIZO+loXYuCfo1m2nsvLej+vJ+JTKRToDSB1aZBz8+krHiXJiqann TYfMkWnGZle44PwIKosUKuCAX0u/q0gMRLBi6rkS7Uhmz3ona6ArndrElOAtm3Rf20Ip unOhUkMEuDx9hhFfgPIXjgx+yQdt00GM9nOtoAAyqVI8sb3VHn4rP5F2DIhg3+LzyACC hKOO//mvFbUWoogQ2uOVV3oX4xzrH7FmFAq34XdQzcHVAES5PPDGsNAILbNrMhAizw80 5qfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=p3vct6D2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g24si6799463edq.128.2020.10.26.10.05.26; Mon, 26 Oct 2020 10:05:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=p3vct6D2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394178AbgJZNOr (ORCPT + 99 others); Mon, 26 Oct 2020 09:14:47 -0400 Received: from casper.infradead.org ([90.155.50.34]:39424 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406990AbgJZNOD (ORCPT ); Mon, 26 Oct 2020 09:14:03 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.