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.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,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 490FCC12002 for ; Mon, 19 Jul 2021 05:56:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CC2996117A for ; Mon, 19 Jul 2021 05:56:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC2996117A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 609468D0103; Mon, 19 Jul 2021 01:56:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B8A08D0100; Mon, 19 Jul 2021 01:56:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 459668D0103; Mon, 19 Jul 2021 01:56:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id 224B68D0100 for ; Mon, 19 Jul 2021 01:56:49 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id AD7908249980 for ; Mon, 19 Jul 2021 05:56:47 +0000 (UTC) X-FDA: 78378278454.28.AEC494F Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by imf15.hostedemail.com (Postfix) with ESMTP id 62F48D0000B2 for ; Mon, 19 Jul 2021 05:56:47 +0000 (UTC) Received: by mail-ej1-f47.google.com with SMTP id qa36so5265122ejc.10 for ; Sun, 18 Jul 2021 22:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TOp1Ku8gOd7uaD1v2W+HlDRwm/aTPQ5TXLmP/t7of6E=; b=WCv6CFd1SMLf3y6ytV+KUsn+wkbYMO8O7Rg2MmWRTX95gIUxh/lDKSf1gjGL03TolG FNDPjRh1dd2XqTCKT1d0hem6XaMxcqhhKu9A11edn96Fwn0rR1e2W6wwSE0AUFYsyxhU MQ7SwyXtUQhioB+SMQip01mruQ2owko+0ajn3Bs5l2F3ig4SSuogQtLG/V9tGICIlF9v oV/LhgDEVT0sbeQZ7fdHtYVKq0N+FzfeiU/p24/y9QrCfacZd8Ec0/zcquIeu/ewLRkR d2hCb5H//13ZMgC/LN6jS38xukifbRbSIQfAH4LT+gpeVj9eF/TjtXpDBtlEEqxqzEOa sG1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TOp1Ku8gOd7uaD1v2W+HlDRwm/aTPQ5TXLmP/t7of6E=; b=NhbMuYVhDSiMiM8FIPH+9gzmAFUGO4DYYxi/2wk1ZoZF9fkDxjlkc/HifN2OFLV8If I9gpQbgFmOFF0W1r2f3taTCorpAfvmnEOkqsXC4SmBbRUQx9NWYTuDYF9y2YbkIlQ9NB +d8UD/lAuvekBC30kFTA/HuMsqZ+zpsF41Oul0wAWKcno9DeSURby4HI5vK0JDKUFZ57 07ZHSo9t/vACWxCwI/d7qijhGU9WfAuqbutsba7w8BSezWmvK2ZY5L+aJedLw3jZ58eL WskePYMV/a/27X3hYksAhmplRLFb8oUgAcVI47O7aHTBuVrAqqUKJQ0GE7S1fh/9ULLI 9XVQ== X-Gm-Message-State: AOAM532PFIcLVEEA/H7y3sFdgiDHE+qM4yA58eFec9/KzhlN/N8c7WJb 1n9sCLOo2ngHkT9vpcybg1fv+enc7+X5lAto9FE= X-Google-Smtp-Source: ABdhPJyCrHxSM/T/Ax6N2f+XnFm9cYmDdKvVzp6+2sTUCAl0g3R6nvPukTe5qd6vt6PcuoMZZuzXSWIADyEI4VwFrJA= X-Received: by 2002:a17:906:718c:: with SMTP id h12mr24875160ejk.6.1626674206125; Sun, 18 Jul 2021 22:56:46 -0700 (PDT) MIME-Version: 1.0 References: <20210717171713.GB22357@magnolia> In-Reply-To: From: Murphy Zhou Date: Mon, 19 Jul 2021 13:56:34 +0800 Message-ID: Subject: Re: [fsdax xfs] Regression panic at inode_switch_wbs_work_fn To: Roman Gushchin Cc: "Darrick J. Wong" , Linux-Fsdevel , Linux MM Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=WCv6CFd1; spf=pass (imf15.hostedemail.com: domain of jenccekernel@gmail.com designates 209.85.218.47 as permitted sender) smtp.mailfrom=jenccekernel@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: jr67tws95ooau83doidtwmmuiqegunjf X-Rspamd-Queue-Id: 62F48D0000B2 X-Rspamd-Server: rspam01 X-HE-Tag: 1626674207-679150 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 Sun, Jul 18, 2021 at 6:08 AM Roman Gushchin wrote: > > On Sat, Jul 17, 2021 at 10:17:13AM -0700, Darrick J. Wong wrote: > > On Fri, Jul 16, 2021 at 01:13:05PM -0700, Roman Gushchin wrote: > > > On Fri, Jul 16, 2021 at 01:57:55PM +0800, Murphy Zhou wrote: > > > > Hi, > > > > > > > > On Fri, Jul 16, 2021 at 12:07 AM Roman Gushchin wrote: > > > > > > > > > > On Thu, Jul 15, 2021 at 06:10:22PM +0800, Murphy Zhou wrote: > > > > > > Hi, > > > > > > > > > > > > #Looping generic/270 of xfstests[1] on pmem ramdisk with > > > > > > mount option: -o dax=always > > > > > > mkfs.xfs option: -f -b size=4096 -m reflink=0 > > > > > > can hit this panic now. > > > > > > > > > > > > #It's not reproducible on ext4. > > > > > > #It's not reproducible without dax=always. > > > > > > > > > > Hi Murphy! > > > > > > > > > > Thank you for the report! > > > > > > > > > > Can you, please, check if the following patch fixes the problem? > > > > > > > > No. Still the same panic. > > > > > > Hm, can you, please, double check this? It seems that the patch fixes the > > > problem for others (of course, it can be a different problem). > > > CCed you on the proper patch, just sent to the list. > > > > > > Otherwise, can you, please, say on which line of code the panic happens? > > > (using addr2line utility, for example) > > > > I experience the same problem that Murphy does, and I tracked it down > > to this chunk of inode_do_switch_wbs: > > > > /* > > * Count and transfer stats. Note that PAGECACHE_TAG_DIRTY points > > * to possibly dirty pages while PAGECACHE_TAG_WRITEBACK points to > > * pages actually under writeback. > > */ > > xas_for_each_marked(&xas, page, ULONG_MAX, PAGECACHE_TAG_DIRTY) { > > here >>>>>>>>>> if (PageDirty(page)) { > > dec_wb_stat(old_wb, WB_RECLAIMABLE); > > inc_wb_stat(new_wb, WB_RECLAIMABLE); > > } > > } > > > > I suspect that "page" is really a pfn to a pmem mapping and not a real > > struct page. > > Good catch! Now it's clear that it's a different issue. > > I think as now the best option is to ignore dax inodes completely. > Can you, please, confirm, that the following patch solves the problem? This one works for me. Thanks. > > Thanks! > > -- > > diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c > index 06d04a74ab6c..4c3370548982 100644 > --- a/fs/fs-writeback.c > +++ b/fs/fs-writeback.c > @@ -521,6 +521,9 @@ static bool inode_prepare_wbs_switch(struct inode *inode, > */ > smp_mb(); > > + if (IS_DAX(inode)) > + return false; > + > /* while holding I_WB_SWITCH, no one else can update the association */ > spin_lock(&inode->i_lock); > if (!(inode->i_sb->s_flags & SB_ACTIVE) ||