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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F84CC433EF for ; Fri, 4 Mar 2022 04:38:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B58688D0002; Thu, 3 Mar 2022 23:38:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B08F38D0001; Thu, 3 Mar 2022 23:38:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F8B68D0002; Thu, 3 Mar 2022 23:38:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0236.hostedemail.com [216.40.44.236]) by kanga.kvack.org (Postfix) with ESMTP id 8FAE88D0001 for ; Thu, 3 Mar 2022 23:38:56 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5390E8249980 for ; Fri, 4 Mar 2022 04:38:56 +0000 (UTC) X-FDA: 79205448672.20.705921A Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf27.hostedemail.com (Postfix) with ESMTP id D03D54000A for ; Fri, 4 Mar 2022 04:38:55 +0000 (UTC) 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-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: D03D54000A X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=loLarWJ4; dmarc=none; spf=none (imf27.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: 7odk9jfeomfoqms7qy96mzdrfbw3mw1f X-HE-Tag: 1646368735-625090 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 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.