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=-7.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 E6FC0C55178 for ; Mon, 26 Oct 2020 13:55:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E5E6722242 for ; Mon, 26 Oct 2020 13:55:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="j13Zm+0X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E5E6722242 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 287816B006E; Mon, 26 Oct 2020 09:55:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 238096B0070; Mon, 26 Oct 2020 09:55:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D91F6B0071; Mon, 26 Oct 2020 09:55:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0122.hostedemail.com [216.40.44.122]) by kanga.kvack.org (Postfix) with ESMTP id D30036B006E for ; Mon, 26 Oct 2020 09:55:47 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7A884180AD801 for ; Mon, 26 Oct 2020 13:55:47 +0000 (UTC) X-FDA: 77414224734.03.cry56_1c0597f27274 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 572AF28A4E8 for ; Mon, 26 Oct 2020 13:55:47 +0000 (UTC) X-HE-Tag: cry56_1c0597f27274 X-Filterd-Recvd-Size: 5727 Received: from mail-il1-f193.google.com (mail-il1-f193.google.com [209.85.166.193]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Mon, 26 Oct 2020 13:55:46 +0000 (UTC) Received: by mail-il1-f193.google.com with SMTP id f16so832379ilr.0 for ; Mon, 26 Oct 2020 06:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=T34Jne3WnifRc7iEE9z5MUbPKqS9loF5a16qtrLnLG8=; b=j13Zm+0XnwOqcOGOpuQET9O2RfehNckeb8yaPUyDzmtyqhCdwkEKn1I9C2QpMi5U9U 2lIk4rBKl1/VajB7yyDvgkoWFWMg+AuX62uIyF1Qic0dsnPlz6c/9aS7zesD/7REIdud 9ZyPYuia+JMp67LRB3AxAihbvlBN1iq+FE0G0j+9WQXZsEseZo3i218DB5TAgu15HsGv EebICGF+VNRtM0z01N9Ls10+g87Zn64WNjwWTfW0pCzyAD6QBRx6MAlM2SJfwbNg9jx/ SI7m+jC+QKREaYWL5MUj2ByZwvaq6JIhdqwZbiPkGwzZFPjkZKftD6g1QNp46MWdzJeQ KrSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=T34Jne3WnifRc7iEE9z5MUbPKqS9loF5a16qtrLnLG8=; b=AcdChP96Tro1CgU12F5U1njmaLM/JKSVdhE7iBRINpPfnL2TGGBdW6qNroeKGj95q2 zljRg99dJr+5dkUijrEehoXimfac2V9XejjPnFv/Tc8sdkOt3yDpfNj1/lxxD8KkMHRA A/3bBRl5izWBqO0v9/7jPZ4hI80VlE7Nrb4X7y/zU6wbyuBHEzsqSSv3GotChq6eNi09 tfPwyPtVcIZWjhjiHshL4IAXg6Ylyrel7iljBwxXtw1HnWLqRILTHkhy/nLxyS/x+NiK Ccg3N9WoZVnF9KsYZXZ2wifZdp9zCQbsXnqMmFq2epGPAgky+rglu0APXI9dm4FV2MyB MAEQ== X-Gm-Message-State: AOAM533lzgxTsjxR7cOhcK67y0ElYT1NYQKHX7S9Fz/uvZpWm+Msmw48 8ggQzAaX/V3qFNGXGdjXRCspjM5tVAE8fw== X-Google-Smtp-Source: ABdhPJwK5V1blQj7A/QIgGgFf9Cdacir5v6joT876+ZwpB24wbUU3k/sgn/wFZ3NJkNxVSUkcPHV+A== X-Received: by 2002:a05:6e02:5c7:: with SMTP id l7mr11066619ils.43.1603720545201; Mon, 26 Oct 2020 06:55:45 -0700 (PDT) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id v85sm6156874ilk.50.2020.10.26.06.55.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Oct 2020 06:55:44 -0700 (PDT) Subject: Re: kernel BUG at mm/page-writeback.c:2241 [ BUG_ON(PageWriteback(page); ] To: Matthew Wilcox , 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, linux-mm@kvack.org References: <645a3f332f37e09057c10bc32f4f298ce56049bb.camel@lca.pw> <20201022004906.GQ20115@casper.infradead.org> <20201026094948.GA29758@quack2.suse.cz> <20201026131353.GP20115@casper.infradead.org> From: Jens Axboe Message-ID: Date: Mon, 26 Oct 2020 07:55:44 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201026131353.GP20115@casper.infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 10/26/20 7:13 AM, Matthew Wilcox wrote: > 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. I've tried to reproduce this as well, to no avail. Qian, could you perhaps detail the setup? What kind of storage, kernel config, compiler, etc. -- Jens Axboe