Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5794618pxu; Thu, 22 Oct 2020 11:11:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8ex1mcpR+9LByx1WVo9v+hbR0MYZjBZd8wGTT5UlVBadh+18VU1zkslTW/iyWEhZwAlCw X-Received: by 2002:a50:d555:: with SMTP id f21mr3454260edj.334.1603390279896; Thu, 22 Oct 2020 11:11:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603390279; cv=none; d=google.com; s=arc-20160816; b=jIBwwWCl+5K/NYJJdnCjRxdg8y+hLfcigYXRzNvV/HtdYXpRqtZ/u1dD45KjB9N2EL 31+pnVCz0NFjM0lopTUDnqBWvhpi6rF+suK9UFe3G+nNhcefmfO22NAygf1BBykZWB02 vPBGQmmYbMnLKzXPqBnnme2+5kr0xdsJgMtoYXZ1DTJ9iBdEot3tdme+7SfFc67lBXk/ JJfjhNXt5xpZynqnGd4cFWzHRMsJ5QkAI0KTaH0wdcjLpeF1Yctk01hHe8xg2jFRf9bk iyVgrm0n9A/2OSTHZj9Ei/WfYkscqyul9QgKAoHd0+rohOvfaNIVbDkV3sgGhmcA2/PD K6tw== 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=xro6DWExEiJhODwXOAby9O4a+I7/GqhPz/+TxrJCSCI=; b=jUYht7YSFahuyDn1996N1aKt1NwyWWa9PmYAYa2aWBguD93Al581hPKbi1f44PEeD5 gJVHZprJ25qcZCB0cTWHzZ24Akg8xliHeUGqYABuxwOiC9nPumZ7nSxLhhyXe+lTcWzq HEwg/IjgxspOaelFbyVg2/qsMto1Qmn7l7rOZ5YlQrI5S2bjKLX3+CHykD285m3+3SAs hRqdYz2j9QhFJVYsY6Z++MAR7O19T01ysiRFcU+EM3z3mCeMgMi/t3/g3KdNCrc8XAz7 EXSHHuxH4NfA/Zc5z9KYT4w5cd0h6AsQMiaSh14Lcs6x5kJOnj44kBJTDggRKR+DjpUF KGvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=PSyTwhKE; 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 gj3si1478622ejb.313.2020.10.22.11.10.57; Thu, 22 Oct 2020 11:11:19 -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=PSyTwhKE; 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 S2898036AbgJVQqe (ORCPT + 99 others); Thu, 22 Oct 2020 12:46:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2897884AbgJVQqd (ORCPT ); Thu, 22 Oct 2020 12:46:33 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A44B0C0613CE; Thu, 22 Oct 2020 09:46:33 -0700 (PDT) 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=xro6DWExEiJhODwXOAby9O4a+I7/GqhPz/+TxrJCSCI=; b=PSyTwhKEJI7x6Yu1qPkYUlYXbj 3NqqmLBtG03MbjTHdDGJBrpt5Ev5AwfD6v1ObDzWTzNpwECQsirZtMgIFPFMcvVoDS+LxyiaDvJVa yQQgYFDKrPbnKsQgzHlZ+UBttzVn4O8gnIaS4m1e4A7cpCdedooUcoKaFbVlb20zznFVPu8+U/hD6 TxA0vBUNaYfrcx55mgpAT7H5P3GLgxVdcQOKi55Ta65jj2LWvJek6vxpiYtgYOMau2fIXK3Up7P6B 6QhfrNiW51zGsPK4jwNiBLey0oCMNYPtzHSN4XMbmo5zMKUcDlGTYuO68J31gzhjz+4qL/cXqZiWx tvHZG5Hw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVdjM-0003Cv-50; Thu, 22 Oct 2020 16:46:24 +0000 Date: Thu, 22 Oct 2020 17:46:24 +0100 From: Matthew Wilcox To: William Kucharski 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: <20201022164624.GW20115@casper.infradead.org> References: <645a3f332f37e09057c10bc32f4f298ce56049bb.camel@lca.pw> <20201022004906.GQ20115@casper.infradead.org> <361D9B8E-CE8F-4BA0-8076-8384C2B7E860@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <361D9B8E-CE8F-4BA0-8076-8384C2B7E860@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 22, 2020 at 07:23:33AM -0600, William Kucharski wrote: > > > > On Oct 21, 2020, at 6:49 PM, 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. > > Looking at __test_set_page_writeback(), I see that it (and most other > callers to lock_page_memcg()) do the following: lock_page_memcg() is, unfortunately, completely unrelated to lock_page(). I believe all callers of __test_set_page_writeback() have the page lock held already, but I'm going to put in an assert to that effect.