Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5787859pxu; Thu, 22 Oct 2020 11:02:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxpf+UEauXWKqHfvLzP9URKZ2RsTyseWLet20SjAMTc4OMQxNC1WyZT+y3jfn4l7KM+PMh X-Received: by 2002:a17:907:9ef:: with SMTP id ce15mr3520978ejc.430.1603389730588; Thu, 22 Oct 2020 11:02:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603389730; cv=none; d=google.com; s=arc-20160816; b=0J2l/68ZhCL0VxXBoAA298MkbFnH12CTUK6/HZWD4zd1MqEYcBQDP30lEqsr6sYuRE 1FUcBmMeMmoJ+VKMxhrFFGEzr4tpr1t6lb4/jwM7X64t4rt+pVaXRLNT9xedNbIgX4R1 lIiUEeFpJz3/AxiZn+3oGNPy1s5dURHaVjnCS8OgpWIHq17vFCfFfDeEQpi2d7lmOIXW JQ3UY1CYxX2vjokPwVy0bUz5quu9hb0mdScG1mkJwhODfTWQ7IkPOiZn4eWc7iyBU+6i JwGTRjucpJWINVvpRBcFVSc0n9q0bdgAqpzCfg7bEx5K3O16brTAAmA2GzEzugomQKzn 1oWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=sTrVyG01AF9hjeuTGF2A4O4cklosqcUKZbhcRBUvpm8=; b=slSwqTjF25doEitUn3+eVRuF6ILdlDa+ms8k0OrYMt5EJbMErqYnEXr1OvOItizN/f GUQ8BUhocrn4MrKHQ6ZsJloDErlW3P4bHMbOlSSZqJXF5s9Qa/a7Mn2aaMo7uxnal/bx f9W7fwpvlBU9JtmTmOCG9sgEWqzJEuIi2RbCza49t+7HelzzShZnZs1FuJ/ODwxL9WFu d1/gvEIXKLyMR/vE8EzbfV2VWWZpoXD74w0lA/rQ5MnIjCrOSumKvd8rEd5b8XKBkuCA A4EEXSWJ9y2qEU53AKP6sffIJLsbfRCzwvS3J9ivs6ALWlbapqWz4MHgB0tbdJ2d9/up v7ww== ARC-Authentication-Results: i=1; mx.google.com; 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 a19si1333493ejp.388.2020.10.22.11.01.47; Thu, 22 Oct 2020 11:02:10 -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; 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 S368652AbgJVPfi convert rfc822-to-8bit (ORCPT + 99 others); Thu, 22 Oct 2020 11:35:38 -0400 Received: from us-smtp-delivery-44.mimecast.com ([207.211.30.44]:38628 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503603AbgJVPfh (ORCPT ); Thu, 22 Oct 2020 11:35:37 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-581-za5zEBnYOSqH-hBOoifJQA-1; Thu, 22 Oct 2020 11:35:29 -0400 X-MC-Unique: za5zEBnYOSqH-hBOoifJQA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 17FAA804B64; Thu, 22 Oct 2020 15:35:28 +0000 (UTC) Received: from ovpn-66-200.rdu2.redhat.com (ovpn-66-200.rdu2.redhat.com [10.10.66.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id C3D9319C4F; Thu, 22 Oct 2020 15:35:26 +0000 (UTC) Message-ID: <7ec15e2710db02be81a6c47afc57abed4bf8016c.camel@lca.pw> Subject: Re: kernel BUG at mm/page-writeback.c:2241 [ BUG_ON(PageWriteback(page); ] From: Qian Cai To: Matthew Wilcox Cc: 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 Date: Thu, 22 Oct 2020 11:35:26 -0400 In-Reply-To: <20201022004906.GQ20115@casper.infradead.org> References: <645a3f332f37e09057c10bc32f4f298ce56049bb.camel@lca.pw> <20201022004906.GQ20115@casper.infradead.org> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=cai@lca.pw X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: lca.pw Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-10-22 at 01:49 +0100, 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. It happened again on today's linux-next: [ 7613.579890][T55770] page:00000000a4b35e02 refcount:3 mapcount:0 mapping:00000000457ceb87 index:0x3e pfn:0x1cef4e [ 7613.590594][T55770] aops:xfs_address_space_operations ino:805d85a dentry name:"doio.f1.55762" [ 7613.599192][T55770] flags: 0xbfffc0000000bf(locked|waiters|referenced|uptodate|dirty|lru|active) [ 7613.608596][T55770] raw: 00bfffc0000000bf ffffea0005027d48 ffff88810eaec030 ffff888231f3a6a8 [ 7613.617101][T55770] raw: 000000000000003e 0000000000000000 00000003ffffffff ffff888143724000 [ 7613.625590][T55770] page dumped because: VM_BUG_ON_PAGE(PageWriteback(page)) [ 7613.632695][T55770] page->mem_cgroup:ffff888143724000