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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 C7F80C2B9F4 for ; Mon, 28 Jun 2021 16:51:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE4A1616EA for ; Mon, 28 Jun 2021 16:51:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231948AbhF1Qxf (ORCPT ); Mon, 28 Jun 2021 12:53:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231918AbhF1Qxe (ORCPT ); Mon, 28 Jun 2021 12:53:34 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68890C061574; Mon, 28 Jun 2021 09:51:08 -0700 (PDT) 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=6jOe7QTRNMP5xH4FY0Zc/Ud/5ESHtYwEOMpkxWcLIPc=; b=qhc5oKFc3JSPo9was/RPdC2Jwv WQgI+Eo+NVClb+IhpPEsFI+xMgMkU/HB4iMbwV3CfSWfw66lQjIXMRw2bKH8/pOVmXO/1WVuseokp Aamut+g+x6aNDsPkEWNy2uyNP2/W3mPREsF+Uv701/auYMiRi0cPkyAgBKJtmA5dP6e099I3D0qly 3n4IG7/0U83eNyEQqB5mq/LiDphi7w+DHr1K7qFpBWMF0aj00tZVn1JSldqno7S0kQxSJTUQk9gtz MRVc05Oa/cH6N+Fs54lyLifjA43HXHKLqGqDjEwOLHhe1apKxmDUNEjCKYRGB/smhzTrKv3ervrHa 9QYbUVew==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxuSp-003GGO-UR; Mon, 28 Jun 2021 16:50:44 +0000 Date: Mon, 28 Jun 2021 17:50:27 +0100 From: Christoph Hellwig To: Josef Bacik Cc: linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 6/6] btrfs: use the filemap_fdatawrite_wbc helper for delalloc shrinking Message-ID: References: <2acb56dd851d31d7b5547099821f0cbf6dfb5d29.1624894102.git.josef@toxicpanda.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2acb56dd851d31d7b5547099821f0cbf6dfb5d29.1624894102.git.josef@toxicpanda.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Jun 28, 2021 at 11:37:11AM -0400, Josef Bacik wrote: > sync_inode() has some holes that can cause problems if we're under heavy > ENOSPC pressure. If there's writeback running on a separate thread > sync_inode() will skip writing the inode altogether. What we really > want is to make sure writeback has been started on all the pages to make > sure we can see the ordered extents and wait on them if appropriate. > Switch to this new helper which will allow us to accomplish this and > avoid ENOSPC'ing early. The only other exported user of sync_inode is in btrfs as well. What is the difference vs this caller? Mostly I'd like to kill sync_inode to reduce the surface of different hooks into the writeback code, and for something externally callable your new filemap_fdatawrite_wbc helpers looks nassively preferable of sync_inode / writeback_single_inode.