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 23357C433EF for ; Sun, 22 May 2022 21:24:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B0B0E8D000A; Sun, 22 May 2022 17:24:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A93468D0006; Sun, 22 May 2022 17:24:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 982FD8D000A; Sun, 22 May 2022 17:24:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 813978D0006 for ; Sun, 22 May 2022 17:24:52 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id EC4F660B74 for ; Sun, 22 May 2022 07:19:33 +0000 (UTC) X-FDA: 79492528626.06.903E59B Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf16.hostedemail.com (Postfix) with ESMTP id 850AE180028 for ; Sun, 22 May 2022 07:19:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=7PKJsj68IInPVINb0fO3beho68vuOikPK51xBQIehs4=; b=xAsYrHh7Hv253E7T10KyKjM/4e IxVhCJ0M1juCWxSPf/LWPFCuGpkPa8PKgqfUm0GdZJjRgXwOMSAGS/e7ADlFVrtsewj7sKEIQYG0Y vdq7UinY0Q7KMduTDKrEkMPAYpEXrJ+X99R4QZ4N6w4sld+FyrGrvOaEVwxxcvaKGoaLK6AVySPBQ ZXL+dWTwKKaYu/fkHzhM65a4pGeJtYSvkFF6VbbmjP/6zc0YUJuoAuLUoH82cqAGqoONKeQIDg40z 34ODzw6mRCZD+CFg6TfYtfvHTs1tfGpbVR28NTgiIdg+bzMIkdk6SZclkbDqKTlbfudbFg2A0/7pK H7tM3FMQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nsfsB-000mKN-IS; Sun, 22 May 2022 07:19:31 +0000 Date: Sun, 22 May 2022 00:19:31 -0700 From: Christoph Hellwig To: Stefan Roesch Cc: io-uring@vger.kernel.org, kernel-team@fb.com, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, david@fromorbit.com, jack@suse.cz, hch@infradead.org Subject: Re: [RFC PATCH v4 07/17] iomap: Use balance_dirty_pages_ratelimited_flags in iomap_write_iter Message-ID: References: <20220520183646.2002023-1-shr@fb.com> <20220520183646.2002023-8-shr@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220520183646.2002023-8-shr@fb.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Queue-Id: 850AE180028 X-Stat-Signature: 3eica3jk8jguj6gsq67z6fgh85s6kdba Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=xAsYrHh7; dmarc=none; spf=none (imf16.hostedemail.com: domain of BATV+c9e7f944c22607b8b784+6846+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+c9e7f944c22607b8b784+6846+infradead.org+hch@bombadil.srs.infradead.org X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1653203960-531941 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 Fri, May 20, 2022 at 11:36:36AM -0700, Stefan Roesch wrote: > @@ -765,14 +765,22 @@ static loff_t iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i) > do { > struct folio *folio; > struct page *page; > + struct address_space *mapping = iter->inode->i_mapping; > unsigned long offset; /* Offset into pagecache page */ > unsigned long bytes; /* Bytes to write to page */ > size_t copied; /* Bytes copied from user */ > + unsigned int bdp_flags = > + (iter->flags & IOMAP_NOWAIT) ? BDP_ASYNC : 0; Bot the mapping and bdp_flags don't change over the loop iterations, so we can initialize them once at the start of the function. Otherwise this looks good, but I think this should go into the previous patch as it is a central part of supporting async buffered writes.