Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1704392pxm; Fri, 4 Mar 2022 01:38:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzuCtYx+4Xf2NZs4eFgJrSNxWS0pQdOCiSZC2MFtocQuplgzk5RFLilTo/aLtxv8F8iBvO X-Received: by 2002:a17:902:7608:b0:151:849c:5345 with SMTP id k8-20020a170902760800b00151849c5345mr17554812pll.124.1646386704380; Fri, 04 Mar 2022 01:38:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646386704; cv=none; d=google.com; s=arc-20160816; b=0vqaARoESMLQbCohexTw/0hkL24mq1vQLKB60YGW2hHgZ24g47u7TkV0Vhf5JwkEh8 Ds4SUdUUS4x6F0n/oPnJHQozGwwpdWVNNPE851QBzpEniQG09HPrJRs2bSmXd6Arknz8 pRaY2evgr6IshT82YFOovPqvvve/QuUGm2eBtAXl5hfwpVC98oN7oc/eaURYTv9CP1Yq 1FhHkAyLFzu8UxjF9tPNyrqvwgrO3Izf3ef8Ix9V3iBNFcvRrkAOK7yD721YibSqU/Ol gfczQdrR7j0IbgoTV/Gj2t6N26i+NYU7j4tQvoYmicJ13JeCkvaxWqLWool+1bcQ817i w1uA== 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=czx5ybB1xeuMipycQ6XWyQQmkQUgRPLvyVJhMpxXE4E=; b=T59uTtEwprRDu43lLYP7PHzn27/YTrmMtz3mWZhDn+6iMo4iD/uxBbSUS3x4D9801X 7l0dGzYyHuTCILQOKQ4Mosg1718gdyvpxJg6ExdQ+UauBwqmJrb0SADI9hQWTXLqEPsL mImrSRW/1/8wxrSNwgybISHjiuG5gnK+65jHd24xKY41s8L+oP/23In7TYX87e98z2d2 7ti9qrhClIDwZdpYc/370B7UkiQpra6XiOBL350B95fRkFaYzGrKYkZm+Ay1JEQTqP/+ u4tXUS5Ua978+NKCmHMdNeX4iQvSBPps9Z0snPCLFYNHemaCjZbRqn93TI2Wt2/aQcBq v0Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=loLarWJ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k63-20020a638442000000b0037c73d5ff14si2606008pgd.556.2022.03.04.01.38.06; Fri, 04 Mar 2022 01:38:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=loLarWJ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237918AbiCDEjn (ORCPT + 99 others); Thu, 3 Mar 2022 23:39:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233158AbiCDEjl (ORCPT ); Thu, 3 Mar 2022 23:39:41 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 850D95DE4F; Thu, 3 Mar 2022 20:38:54 -0800 (PST) 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=czx5ybB1xeuMipycQ6XWyQQmkQUgRPLvyVJhMpxXE4E=; b=loLarWJ4WtSnJ57hlqBMBpXGsu 8tNCU9LveNsYNvRsA4XQ5gxSfVXEPgvLLnKS6zcq2KB4HB7Tr3OvpU/KEoxOieOWs72IDV/5BJMGZ 6igzmrH8i/YDHa0I6JZMSVnLSJpwQkG8PKiiGCtNxaohx7CJsDP9bHWYzYPNsGGG41ki9XWnxotPx IxNcIqSz4UoKGO2G80xn9VgZ+wcegYC2AYauAtItwc2/qQhWKqpvh7B95R3FezT9hZVyp6+oWjTQ5 WdkyZcbc2VbPAfYGPXq3UCBsTeadCio+69T874A6M8ra25JPEqTceVRQtUepQFomkg1lASSOFOlgH 1LXiMO9w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPziN-00CIGg-0l; Fri, 04 Mar 2022 04:38:51 +0000 Date: Fri, 4 Mar 2022 04:38:50 +0000 From: Matthew Wilcox To: Hugh Dickins Cc: Andrew Morton , Jan Kara , Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH mmotm] mm: warn on deleting redirtied only if accounted Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 03, 2022 at 08:25:50PM -0800, Hugh Dickins wrote: > filemap_unaccount_folio() has a WARN_ON_ONCE(folio_test_dirty(folio)). > It is good to warn of late dirtying on a persistent filesystem, but late > dirtying on tmpfs can only lose data which is expected to be thrown away; > and it's a pity if that warning comes ONCE on tmpfs, then hides others > which really matter. Make it conditional on mapping_cap_writeback(). > > Cleanup: then folio_account_cleaned() no longer needs to check that > for itself, and so no longer needs to know the mapping. At first blush, I like this a lot. Will look more in the morning.