From patchwork Thu Mar 2 23:16:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13158026 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 298B6C678D4 for ; Thu, 2 Mar 2023 23:16:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4858D6B0072; Thu, 2 Mar 2023 18:16:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 436186B0073; Thu, 2 Mar 2023 18:16:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2FD976B0074; Thu, 2 Mar 2023 18:16:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 20DE76B0072 for ; Thu, 2 Mar 2023 18:16:56 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id E3D4014105C for ; Thu, 2 Mar 2023 23:16:55 +0000 (UTC) X-FDA: 80525520390.23.2DDCE99 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 14F68140011 for ; Thu, 2 Mar 2023 23:16:52 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=e5UibSOr; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf09.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677799013; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1eE9Pafa530L5JjpUU74EsDdw6S9K1gsLvm9PBz92W8=; b=nd2mE/eQS06ceRIw89+/ATDN0lsgbkuhKp/0Lmf8p4ihkVqKb3Yv+TThYKsTBNpLdwO+sn FrfxujxZFUF7CpJokYvpBdTlwqlDKi++jAyVmSb5mHd1YJHcreDTpxxJnFaGiIkB48A0/B Elx6W878BBygDXJqBdfEsEbAXFKHaLY= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=e5UibSOr; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf09.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677799013; a=rsa-sha256; cv=none; b=I1nePhIAc72/mFz4IlGwc7AOJl/pv3Di8zNa8y6JydxGBqW5E0kLlnoXjsSBzUS58YNBhw ZcSy/kAJ2+GBBGajnDnIwnsEht/HvDvPnIQTx7/fEe9vdxdBTjfXD8/k2K+1hsORhUVi8e /fo3aYIJ8JrNWhtDByprz1peoPtlNow= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677799012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1eE9Pafa530L5JjpUU74EsDdw6S9K1gsLvm9PBz92W8=; b=e5UibSOrWGxcxGg2l4E3lQMiSC1vlGR9bBNe4k4Xs0e4w/tEBHZWvaouNgCKh5KXj4bFMG 8Ys+EikQqRfQrcspmFb2sOoqBxSsAyqf0Poi0BA0SIjFAOdw7ZtJGPv/6kveQcpYEK8z1O vUeSrDSMlaDIn9EU6KQSSsgLkSZVI1E= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-622-zwFLchJEPOeBqPxHgNImPw-1; Thu, 02 Mar 2023 18:16:47 -0500 X-MC-Unique: zwFLchJEPOeBqPxHgNImPw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 630DB800B23; Thu, 2 Mar 2023 23:16:46 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54038440D9; Thu, 2 Mar 2023 23:16:44 +0000 (UTC) From: David Howells To: Linus Torvalds , Steve French Cc: David Howells , Vishal Moola , Shyam Prasad N , Rohith Surabattula , Tom Talpey , Stefan Metzmacher , Paulo Alcantara , Jeff Layton , Matthew Wilcox , Marc Dionne , linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Steve French , Andrew Morton , linux-mm@kvack.org Subject: [PATCH 1/3] mm: Add a function to get a single tagged folio from a file Date: Thu, 2 Mar 2023 23:16:36 +0000 Message-Id: <20230302231638.521280-2-dhowells@redhat.com> In-Reply-To: <20230302231638.521280-1-dhowells@redhat.com> References: <20230302231638.521280-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 14F68140011 X-Stat-Signature: s9p7d1nzpfyxzu31brreuw6joojbm77f X-HE-Tag: 1677799012-807018 X-HE-Meta: U2FsdGVkX1/VOcgjklmwSZaLbiAE24/xQy0sL4V79gNVWYwYPkNjG5IMI3u7bA86eEWH4nTEM+iHeoGR6EpHa3XqJFvlFoZ27WZqwdutf7dZRlZbJzGrJgxE4a4Wipqo+sFyYfcRxaXYHBU39bMQuK6XagfpnqHO9KGm64Hkz0tBU9NTfGtDnzK+6eGvP+nQJ8pU2BaJH46QM9RJJ90+zvQmb2GWZc4sEL35pZooQYgD/RAU5/Y/09TYMSFFQj0TCHb1PAfyYcER+iTMjpt4X+5Y19euqyPwg2cwO3+NVrxWRot0VYVAI9F5/IPsFFpmS5Z96s0n/vNz/9LuFyW8wK6xwXkT9+Bs1t/BZHiTH89nYzWwP4aPoIka14dlcBcJ75Pjy2ewUn6q+y2eGDAMB5lS9l7EoUstrpPY0rqyeo/r+yNQB7r3IVEaizkShuvWlYzJGt9Ee8uh281ccElEhn+Io6ecL9BZgWk6IeL5z+KZJO9Mkyv/6HYB/XvRhnHjwXNf+tEp3xnFqvkMXtjiCNCL8rPvpulYFQ9mCM6ziYdHripCOGtbnwBgDfALRiE+xrvXFVYD61n/OF0uEN7c0ZdV8RjAaCF9Ao6CtvWjezE5JNZcQaYvX3QkP1+xu4ijJuMqH0Qzr1lmmFfjlINr/SPs6cDuXet4I4qBE4XkT/cwfIaNgMbeBoHtE3JrxdMG6Aa7zOsvA084xuuUmS/eCZsVmn/OjEQ6xi9f12JqNOdStUXczYWoJfh/+i5C2ZmYz/5bbJ/P9pEW+uaw/tpA6bu2Kxa1MBfhwL2yK/BVXQdBbs1NPuqNLPNNOBGUUJ7Vecll7orVkLxy4cji3JpI8oIdI1DW4gv5FjGO1Sw/IRGJLBzMVQHSL+JnQFRxTJihH8FsV/sA/YPjqZCf1sI36qsOgoe0da0dopbKqmGJZnIhYegGu9PtigFe+FfGsNpJ+BfWQg0BVtGWmgMeoaJ AuebaAfn CMQUaelSkjpC97LEqcOFV2Pny4Qsc8wwyPFpcLJtRpJlWmd+52FQBtuDIcjbYdLsltcFH3xDiM1y3J3NoSYC0WzjM1zCsnz76nA88vjPKSfwfqKWh0btlY6r7YobxnGVSqTgP3tKEOB+ci6apORVtCoj46QvNIrGl3ZgnP5/ZgToTKKErkHSNscvqYmRR8+NSaylH5a0tEmI9nAkBdDnkIadWWS5trMFzjJ5oTyteariY20P/49ZGvSu7IJWof7o6xmyiYHjuWz+sC944keZWHPyULNCtF5CumiwDhQyOuD7d9UuYicwzBqKE3Xsd7XUbb58eUonI8plevF4TT1XewFolWV7y4ROHMnYq8Ev8flWzvYBcw+MUfFLcYqvxZNSCehoSdDej7doyYn6j0Xoc/d+QPcKfGBJSbdJ267d1fvpy3LGYik+q+U9eaFj7E2B5vUzXeugtkA9yJ6lu6bh4tmwCjuSFPouE+lBjfxr8Wriw88AxkcpdsQIw/cY8+RJjW0VowWug162DMaIPfa9jyWwkWgJ+mQgtatqacKNaLodxGkPvL4JNS4+D4H+7KIrAk8nJsA1MbbRm49xqMrhrsiP6dQj/05mkul7abji+rcpDelwUnU8+jYbypK8UIGsMp9BG3wOzBqeAkjczSgXjo8wiVqeJ6hXSttszPcX1cpXeW8GysHDwvcHohOe5NRIho1f6nlbjE4jP96M= 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: Add a function to get a single tagged folio from a file rather than a batch for use in afs and cifs where, in the common case, the batch is likely to be rendered irrelevant by the {afs,cifs}_extend_writeback() function. For filemap_get_folios_tag() to be of use, the batch has to be passed down, and if it contains scattered, non-contiguous folios, these are likely to end up being pinned by the batch for significant periods of time whilst I/O is undertaken on earlier pages. Further, for write_cache_pages() to be useful, it would need to wait for PG_fscache which is used to indicate that I/O is in progress from a folio to the cache - but it can't do this unconditionally as some filesystems, such as btrfs, use PG_private_2 for other purposes. Signed-off-by: David Howells cc: Steve French cc: Linus Torvalds cc: "Vishal Moola (Oracle)" cc: "Matthew Wilcox (Oracle)" cc: Andrew Morton cc: linux-afs@lists.infradead.org cc: linux-cifs@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/2214157.1677250083@warthog.procyon.org.uk/ --- include/linux/pagemap.h | 2 ++ mm/filemap.c | 58 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 0acb8e1fb7af..577535633006 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -741,6 +741,8 @@ unsigned filemap_get_folios_contig(struct address_space *mapping, pgoff_t *start, pgoff_t end, struct folio_batch *fbatch); unsigned filemap_get_folios_tag(struct address_space *mapping, pgoff_t *start, pgoff_t end, xa_mark_t tag, struct folio_batch *fbatch); +struct folio *filemap_get_folio_tag(struct address_space *mapping, pgoff_t *start, + pgoff_t end, xa_mark_t tag); struct page *grab_cache_page_write_begin(struct address_space *mapping, pgoff_t index); diff --git a/mm/filemap.c b/mm/filemap.c index 2723104cc06a..1b1e9c661018 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2339,6 +2339,64 @@ unsigned filemap_get_folios_tag(struct address_space *mapping, pgoff_t *start, } EXPORT_SYMBOL(filemap_get_folios_tag); +/** + * filemap_get_folio_tag - Get the first folio matching @tag + * @mapping: The address_space to search + * @start: The starting page index + * @end: The final page index (inclusive) + * @tag: The tag index + * + * Search for and return the first folios in the mapping starting at index + * @start and up to index @end (inclusive). The folio is returned with an + * elevated reference count. + * + * If a folio is returned, it may start before @start; if it does, it will + * contain @start. The folio may also extend beyond @end; if it does, it will + * contain @end. If folios are added to or removed from the page cache while + * this is running, they may or may not be found by this call. + * + * Return: The folio that was found or NULL. @start is also updated to index + * the next folio for the traversal or will be left pointing after @end. + */ +struct folio *filemap_get_folio_tag(struct address_space *mapping, pgoff_t *start, + pgoff_t end, xa_mark_t tag) +{ + XA_STATE(xas, &mapping->i_pages, *start); + struct folio *folio; + + rcu_read_lock(); + while ((folio = find_get_entry(&xas, end, tag)) != NULL) { + /* + * Shadow entries should never be tagged, but this iteration + * is lockless so there is a window for page reclaim to evict + * a page we saw tagged. Skip over it. + */ + if (xa_is_value(folio)) + continue; + + if (folio_test_hugetlb(folio)) + *start = folio->index + 1; + else + *start = folio_next_index(folio); + goto out; + } + + /* + * We come here when there is no page beyond @end. We take care to not + * overflow the index @start as it confuses some of the callers. This + * breaks the iteration when there is a page at index -1 but that is + * already broke anyway. + */ + if (end == (pgoff_t)-1) + *start = (pgoff_t)-1; + else + *start = end + 1; +out: + rcu_read_unlock(); + return folio; +} +EXPORT_SYMBOL(filemap_get_folio_tag); + /* * CD/DVDs are error prone. When a medium error occurs, the driver may fail * a _large_ part of the i/o request. Imagine the worst scenario: From patchwork Thu Mar 2 23:16:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13158028 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 4E469C7EE30 for ; Thu, 2 Mar 2023 23:17:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CEB8F6B0074; Thu, 2 Mar 2023 18:16:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C4F476B0075; Thu, 2 Mar 2023 18:16:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AED426B0078; Thu, 2 Mar 2023 18:16:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A1A156B0074 for ; Thu, 2 Mar 2023 18:16:59 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 6E7EB805D4 for ; Thu, 2 Mar 2023 23:16:59 +0000 (UTC) X-FDA: 80525520558.22.CAC4197 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf29.hostedemail.com (Postfix) with ESMTP id 109ED120012 for ; Thu, 2 Mar 2023 23:16:56 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="T+EU/v3L"; spf=pass (imf29.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677799017; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=nNYSQ/Y9B3aZRJt+LYUgV6EcG7vLla4aEHu0riyXHik=; b=RWSBfCp+TT+w1oc7hGxPraptaaLC2m3VTpk9V2UPI0m0EMXwptmZv265fkCUeEwNIdHV8r 17f8vIGgvf0jIHhTl0uBPcAdLl7RflNqEGf4rImcIOKevpoIYQdCkbTFJFqdK0aoi5fLIy XNunKik8+eV678tjZfzjqO9VsyCxsfc= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="T+EU/v3L"; spf=pass (imf29.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677799017; a=rsa-sha256; cv=none; b=xFWj0+Ez0eOgyolHNo9XETLjtPJi/LsSF+VuJjpWXpHx9NGKDyOkyZsCYaPH5hcgrYIEc+ cc4y1W5l9CeAtefyEzfijZaxSAQ0rxsnoOeLxrVz/THgfGfK1cyhsbpwb9Hicrx06klTA3 8BSRyI5EDqNfM3NWHeliS7sTdG+xJWc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677799015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nNYSQ/Y9B3aZRJt+LYUgV6EcG7vLla4aEHu0riyXHik=; b=T+EU/v3L66r3qxhADmmDUXrcr/7+6v3GBscNSRndEYbWpF2KSgkAsZ2+15KbI7Dujc2Rek psHTF3FhgX5KqDiaAJYaK+3E/ZuLP8DJPJOVBbQXIPf82qryOD8WFZLg64jDQw7XwoRVXW s6A6SnVXRLZ03wYrGa4CwVFtpCaHJh4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-640-Ema7s1klNeSsDP6d3fPMHw-1; Thu, 02 Mar 2023 18:16:50 -0500 X-MC-Unique: Ema7s1klNeSsDP6d3fPMHw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2767F1C05AC1; Thu, 2 Mar 2023 23:16:49 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15443492C3E; Thu, 2 Mar 2023 23:16:46 +0000 (UTC) From: David Howells To: Linus Torvalds , Steve French Cc: David Howells , Vishal Moola , Shyam Prasad N , Rohith Surabattula , Tom Talpey , Stefan Metzmacher , Paulo Alcantara , Jeff Layton , Matthew Wilcox , Marc Dionne , linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Steve French , Andrew Morton , linux-mm@kvack.org Subject: [PATCH 2/3] afs: Partially revert and use filemap_get_folio_tag() Date: Thu, 2 Mar 2023 23:16:37 +0000 Message-Id: <20230302231638.521280-3-dhowells@redhat.com> In-Reply-To: <20230302231638.521280-1-dhowells@redhat.com> References: <20230302231638.521280-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 109ED120012 X-Stat-Signature: ywf5ruw6t9ofqa6k7wu8nrcme7767jjh X-Rspam-User: X-HE-Tag: 1677799016-227282 X-HE-Meta: U2FsdGVkX1/7DJP3cXtnOyD2n3wI1kd/Rcj3z5pVILR0+EUIahjI+PsPQGMAxoslSxqMh55iXgUcPxzs1+tdy3sAQgOlsiL706564T2e0fXXaZxciVyb4uJXNg+HIPNSXBcSqMk8wW0C1YhC8GpRZxcF1lmzoDHM4L50ycUP7f6LYgOLkm0cJEdxd9k3kRxejwF/Os/goMq4gurj7Kz0LFOAqHhgur9BlGlZ/x3BnoW25j/31m4NbJGg+OzzXf1I7lHR6G9dtgJWu00hhFJrLuySHL+6ZL/RI33Y7j+LnEPQ/e2TSdG+sqqDT2mB26XG28IN3N5N1YhAiivPB1MfjX8FCkH3SrNVmQwyD0RlCgjEDQTNKudC8FBMwXjCLFk/a0dc3Rtk4gYZ9NKkzitJrKVk1PlKiGQBAY2SRWvKJKxSGgHr2gFzdbCMKn0C/3nr1F6e6gZj3IDNVBF6WhLhCwV/blpXG2i/mqBu4BuTz8Y7STPF4iT2aQWCR6azjcQX84FEi1ZgbpBJYHgGqC0DqD3b0K/m7KOFy1Rc59YAtR/tvpIJUX8a9/biiJyHAmStOt+FmANLu02A+d/9NO3K2LmdgTS8hsBGXHivsL0f1wTow/fqj7IbbR5cnyCS9cCFJ3QdDq2hsHvvBc4E9WXC3ezxysBDpHa1Tf32aVClxhFTFAVXyXUwwMhQbcWcVh0gsdBJWNrXME3F5gBi+KLBYG+VVPgRdaL7QMiVvCyZbbK1iecioyPrn6B/JcV2asS5Fi3vnXvwVTSMiWyWJTAqYX02GNNYFLoJaPpWuhWu36gDfMxxxOBqHVuSr6rCpUaXXFDXCmBRPSx0YE8GbAkcG+oNmooav86i5tDGTiro5d9PtoUur79vyud/Y8XqRn0BEv8hjIkoBqI9s2BEHPD35wulkqpcnKakBhcGm6hqCUcinky5cCgENKVhpSG0UV7E2QD7S/sSMAfhvONQ3qD YZInhHs5 EN4gPsYnVPL/c/cwwnymCpddxDo3EpJWD5rtxSwYgEzgz9EWjHwX6BUJLk3ilEhos2iCz3IBUnwTBXyJIVU5PSQvpaErk2QavJGVLy7Fpf9/bV3/zkXc06OggKPiFjcW8M7901h3nb061OH13CuAV/m7o1H+MzTVLD6WJlBrOeE6GTDn8muJfkk37DD7MIa1bS9tuhqAXKoY/l8cYRH+Uuhk7n97Rzf0nJGCCoVksmr4VclEqIGewBifGSWnUQYZuyqq4h8ETYGHumGGD3IzhyeM/fvKLPzl2zgYaKInL8d5Y/Gu01koXHuDtp9ZiJ8bn5UleDmp3ztZ/ew4bzAjEZmrKAxNqFHO1JqU9fking6DKVjAJjyfvL7j/+y89dy9q0ZybjQaTpV2MK2UjG2wzDfZmffCPpSPfljW2hnmHgmJ5iw4iYNhOrnvHyF8rMcoYfMclMO0ZhywoaLuwemOJfcLn10hhS1zQeCnefcWTx4phVZjkcmyv9zKL3Njq8nX9S0sTPNwnbEbTbmb49u/mQYaSzVKwTOY1NvfI8qplNcyoEsKwLqReOAQJH0lXX9/oABveT9vwE2XPAxtGqL1tkjF503LLER6DQxKiLzgn1KkteV3PU3QqqMoy53XLCWj6s+U5cMseC5v26SOU1byXr/QxKlKP6Kb2XmEmWenfUUsLAmXbs1KqZyHyqEZYN2zw3vIiyUPw/7oqNpC2wGgghgG2zhmPNFa8MqM02faUl7MG9I6TklJDtq5Wtw== 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: Partially revert the changes made by: acc8d8588cb7e3e64b0d2fa611dad06574cd67b1. afs: convert afs_writepages_region() to use filemap_get_folios_tag() The issue is that filemap_get_folios_tag() gets a batch of pages at a time, and then afs_writepages_region() goes through them one at a time, extends each into an operation with as many pages as will fit using the loop in afs_extend_writeback() and submits it - but, in the common case, this means that the other pages in the batch already got annexed and processed in afs_extend_writeback() and we end up doing duplicate processing. Switching to write_cache_pages() isn't an immediate substitute as that doesn't take account of PG_fscache (and this bit is used in other ways by other filesystems). So go back to finding the next folio from the VM one at a time and then extending the op onwards. Fixes: acc8d8588cb7 ("afs: convert afs_writepages_region() to use filemap_get_folios_tag()") Signed-off-by: David Howells cc: Linus Torvalds cc: Marc Dionne cc: Steve French cc: "Vishal Moola (Oracle)" cc: "Matthew Wilcox (Oracle)" cc: Andrew Morton cc: linux-afs@lists.infradead.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/2214157.1677250083@warthog.procyon.org.uk/ --- fs/afs/write.c | 118 ++++++++++++++++++++++++------------------------- 1 file changed, 57 insertions(+), 61 deletions(-) diff --git a/fs/afs/write.c b/fs/afs/write.c index 571f3b9a417e..2ed76697be96 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -704,87 +704,83 @@ static int afs_writepages_region(struct address_space *mapping, bool max_one_loop) { struct folio *folio; - struct folio_batch fbatch; ssize_t ret; - unsigned int i; - int n, skips = 0; + int skips = 0; _enter("%llx,%llx,", start, end); - folio_batch_init(&fbatch); do { pgoff_t index = start / PAGE_SIZE; - n = filemap_get_folios_tag(mapping, &index, end / PAGE_SIZE, - PAGECACHE_TAG_DIRTY, &fbatch); - - if (!n) + folio = filemap_get_folio_tag(mapping, &index, end / PAGE_SIZE, + PAGECACHE_TAG_DIRTY); + if (!folio) break; - for (i = 0; i < n; i++) { - folio = fbatch.folios[i]; - start = folio_pos(folio); /* May regress with THPs */ - _debug("wback %lx", folio_index(folio)); + start = folio_pos(folio); /* May regress with THPs */ - /* At this point we hold neither the i_pages lock nor the - * page lock: the page may be truncated or invalidated - * (changing page->mapping to NULL), or even swizzled - * back from swapper_space to tmpfs file mapping - */ - if (wbc->sync_mode != WB_SYNC_NONE) { - ret = folio_lock_killable(folio); - if (ret < 0) { - folio_batch_release(&fbatch); - return ret; - } - } else { - if (!folio_trylock(folio)) - continue; - } + _debug("wback %lx", folio_index(folio)); - if (folio->mapping != mapping || - !folio_test_dirty(folio)) { - start += folio_size(folio); - folio_unlock(folio); - continue; + /* At this point we hold neither the i_pages lock nor the + * page lock: the page may be truncated or invalidated + * (changing page->mapping to NULL), or even swizzled + * back from swapper_space to tmpfs file mapping + */ + if (wbc->sync_mode != WB_SYNC_NONE) { + ret = folio_lock_killable(folio); + if (ret < 0) { + folio_put(folio); + return ret; + } + } else { + if (!folio_trylock(folio)) { + folio_put(folio); + return 0; } + } - if (folio_test_writeback(folio) || - folio_test_fscache(folio)) { - folio_unlock(folio); - if (wbc->sync_mode != WB_SYNC_NONE) { - folio_wait_writeback(folio); + if (folio_mapping(folio) != mapping || + !folio_test_dirty(folio)) { + start += folio_size(folio); + folio_unlock(folio); + folio_put(folio); + continue; + } + + if (folio_test_writeback(folio) || + folio_test_fscache(folio)) { + folio_unlock(folio); + if (wbc->sync_mode != WB_SYNC_NONE) { + folio_wait_writeback(folio); #ifdef CONFIG_AFS_FSCACHE - folio_wait_fscache(folio); + folio_wait_fscache(folio); #endif - } else { - start += folio_size(folio); - } - if (wbc->sync_mode == WB_SYNC_NONE) { - if (skips >= 5 || need_resched()) { - *_next = start; - _leave(" = 0 [%llx]", *_next); - return 0; - } - skips++; - } - continue; + } else { + start += folio_size(folio); } - - if (!folio_clear_dirty_for_io(folio)) - BUG(); - ret = afs_write_back_from_locked_folio(mapping, wbc, - folio, start, end); - if (ret < 0) { - _leave(" = %zd", ret); - folio_batch_release(&fbatch); - return ret; + folio_put(folio); + if (wbc->sync_mode == WB_SYNC_NONE) { + if (skips >= 5 || need_resched()) + break; + skips++; } + continue; + } - start += ret; + if (!folio_clear_dirty_for_io(folio)) + BUG(); + ret = afs_write_back_from_locked_folio(mapping, wbc, folio, start, end); + folio_put(folio); + if (ret < 0) { + _leave(" = %zd", ret); + return ret; } - folio_batch_release(&fbatch); + start += ret; + + if (max_one_loop) + break; + cond_resched(); } while (wbc->nr_to_write > 0); From patchwork Thu Mar 2 23:16:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13158027 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 18E31C6FA8E for ; Thu, 2 Mar 2023 23:16:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 809666B0073; Thu, 2 Mar 2023 18:16:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B8F76B0074; Thu, 2 Mar 2023 18:16:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60BDB6B0075; Thu, 2 Mar 2023 18:16:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 54FEC6B0073 for ; Thu, 2 Mar 2023 18:16:57 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 2B770A072E for ; Thu, 2 Mar 2023 23:16:57 +0000 (UTC) X-FDA: 80525520474.10.F3A2B7B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 74FC5C0002 for ; Thu, 2 Mar 2023 23:16:54 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="WzM+D/cd"; spf=pass (imf22.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677799014; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ix2GZROjqu1lNaAS5h0hXsC2zG3GiI8z8sp15KcpJfk=; b=I477rjmbcXlTSEqcZjw86wSKHyhG+KPITzrU6wGA9gKCCSAil7xq0NOVYN/Zca+geQx2Ul fcPVkYEXJhxolUGRBFXdW6wZ81yNQsppjFT7+aH3T28X4ZKz4XP1Eb52VZnUE2apPnKMIe oL/lQzQizmX3sSfbbESLZt/uUEDzKtY= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="WzM+D/cd"; spf=pass (imf22.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677799014; a=rsa-sha256; cv=none; b=LszAn+5NXNLPXxLqr4IKpN5XFy76GvrAjhjEf5SfGI8mwzeqP4oqANv2oBt3jlgTbwL4y2 UznmtTgEkb77oe7V1fRGvFetFQl67I4IaMZoEIrW/A0V8DAuK8GzKca2xD0dWZUwZU0tP4 lPCQ2HK+mrUfeDcgiE2tt59sDNRLhBE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677799013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ix2GZROjqu1lNaAS5h0hXsC2zG3GiI8z8sp15KcpJfk=; b=WzM+D/cdM0VPTcRGwtqBvId1u+uvFto+MLPyDBkPB3LLCnXdhotpiqfboZb7MnuewgOqWW EXqTyuqDD4EXenIMxX78JqIgl4cqce86OanCSeGB5cVEn9Y9giUHkclLSQE3a6Vsb3O04v EX1uAXtvdfTCDSjw8HRh02shVamgHu4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-190-zQT8bSDzMRqgB_Iir98xAw-1; Thu, 02 Mar 2023 18:16:52 -0500 X-MC-Unique: zQT8bSDzMRqgB_Iir98xAw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4BAA85A5A3; Thu, 2 Mar 2023 23:16:51 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6EE72166B26; Thu, 2 Mar 2023 23:16:49 +0000 (UTC) From: David Howells To: Linus Torvalds , Steve French Cc: David Howells , Vishal Moola , Shyam Prasad N , Rohith Surabattula , Tom Talpey , Stefan Metzmacher , Paulo Alcantara , Jeff Layton , Matthew Wilcox , Marc Dionne , linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Steve French , Andrew Morton , linux-mm@kvack.org Subject: [PATCH 3/3] cifs: Partially revert and use filemap_get_folio_tag() Date: Thu, 2 Mar 2023 23:16:38 +0000 Message-Id: <20230302231638.521280-4-dhowells@redhat.com> In-Reply-To: <20230302231638.521280-1-dhowells@redhat.com> References: <20230302231638.521280-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 74FC5C0002 X-Rspam-User: X-Stat-Signature: nezu5zwnogoiro94ddqbwdts9ji6qehh X-HE-Tag: 1677799014-312782 X-HE-Meta: U2FsdGVkX1/c5fie80N9WsCU3/2hfuSAlAvG4KF/Qpw8kseNTAdXZWD3Cs3r5Sje0mmqOOuEZH2ANHN8sBofI6SE2wEN931cDfcYiiuE3vhd4I64wcxVH3gH1lNsmVBmkSRFud8xPQtUrEWnAlYvQXaOOmzshoKUAHBwDesNNBC186mfxbrhcEksrdTSXtUkgb1DcASqd01aXp/hdmIynRgEEk52tQMQbqoMcmFr3pQNfCh8XAbEpgwu6C/SXwY7pY4DcX+XzKQc7/fWWk1d5CuRgCxFTWTmypwcHkxpSv18BL/BmZJTwEAcyJIOrX1TL7mt1r8umrnveQDHwh4xf3vePHLUApap0LjUvPYcR6J+bIlM6LlWm+BZ8Zc0lS4tBPzqOGFyi/wqDrsdKG0LZcgB4JfTQqGbvy1UYzKtSOKdQe7AwUme36gxztbUEZrT9b7HF/1qTCIVivHSe60+VcvMm6NZ3E2tOaiFJiegzDbyeqksRSviOope2t1r8Sw3xz7DMgeo9rnmJtriGv74nNC0EA3OwB/DnsBedCamO9d4YT9+MuFPug1XRC749dtFM66+O9BsrE3XFJHhn3IpH9Xl0if32bcAu5ARd5wsmXvkBF8kETJN6VMwC+/QnLLvl8X5Hvc3FhIap+jIJK0wk/68yPiDWWwqXipe0Jn1BcTpPqY195KOt3uv0ocENiwaYkK/vuFPAHiNXlJC+MoJ4sXJrxaRpl+ebhr5boftsD3rogPIAWliO0eYy1u/8Ad9PckwBS/laVeD09hSr1CPLRO+InO05yZSnKai4fticjulhbFyeJ/jTLz2BeKlC9ircPeYtHwB9TIrB7K7am3PQCgCsZwB5ZqJM1YcqxacvoNS+k3ZyagcTQrwULAbnJbOt2F7V1d03ae/wuTqtAhqWZ7IEHhXHlQPY9xudd8MG0105LaZ4W8tIZyFPjspvN0RPUfCVxball50IlMaZGL vOqNsbHd VxudG3qmnLzSlMNL85OOrGSKiMAd6wjiwFJATkhJ39fcUJ2czPHClgwYmTwiTBAf+X73Zy23XIkKxSHHDDrqbWQ67W1Moxv/DdqpPgKjaH3T6VtYSSeaCOF2BLpDZgiI5iXULtIVgTSCClkxzB3VfVPDeKHwnLO3XXRDMY+i4V94aw5uHjRc5cmA8cfhVv0t36K7pR6hzlOu/e5IjyAk+wlyVgoFPo8Js7OLqRd2wQivtsVtMhU8NekNYZtbvyomqiqSek0vAfoblaJKvtJKvgsHWZo8JiwF09QuPqrt36IFlVhoQyBX/EGQWFsnKCwiI6FmNzLD9nvOcKcoSd3KiL0lxI/gb3MCarRLc/qHGAkMBpyEqj79mAv1c/S4XyE+iLDbMDp3T1iAIkUnEcflcib2McCl+IDieWq1PPgTALpdNHxpJYFpMB1oavXuddsvbCTHtiUVFZUfAzy91HAcENcajlLDOrORoELKiTSsru8/4itgvPVwLfDllvcsLhUJnO2SZiBgZMnx5LrTcQw53rBPdcR2yeDuf+19E3kWfXEgA8wqlAwh0IO7IGKvfK5ouLeFdIAJuK9DxrYiZ0b4ETCFW+gmI90V9BLOSmv2YjUf22BxsYEyQC14jKhdtlrmbgNyC7tWhuzKXYoiHl46+HfPKagTiOwSF5l4U4zg1awWqy03q6yw6cU7Stg== 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: Mirror the changes made to afs to partially revert the changes made by: acc8d8588cb7e3e64b0d2fa611dad06574cd67b1. "afs: convert afs_writepages_region() to use filemap_get_folios_tag()" that were then mirrored into cifs. The issue is that filemap_get_folios_tag() gets a batch of pages at a time, and then cifs_writepages_region() goes through them one at a time, extends each into an operation with as many pages as will fit using the loop in cifs_extend_writeback() and submits it - but, in the common case, this means that the other pages in the batch already got annexed and processed in cifs_extend_writeback() and we end up doing duplicate processing. Switching to write_cache_pages() isn't an immediate substitute as that doesn't take account of PG_fscache (and this bit is used in other ways by other filesystems). So go back to finding the next folio from the VM one at a time and then extending the op onwards. Fixes: 3822a7c40997 ("Merge tag 'mm-stable-2023-02-20-13-37' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") Signed-off-by: David Howells cc: Steve French cc: Linus Torvalds cc: Shyam Prasad N cc: Rohith Surabattula cc: Jeff Layton cc: Paulo Alcantara cc: "Vishal Moola (Oracle)" cc: "Matthew Wilcox (Oracle)" cc: Andrew Morton cc: linux-cifs@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/2214157.1677250083@warthog.procyon.org.uk/ --- fs/cifs/file.c | 115 +++++++++++++++++++++---------------------------- 1 file changed, 49 insertions(+), 66 deletions(-) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 4d4a2d82636d..a3e89e741b42 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -2864,93 +2864,76 @@ static int cifs_writepages_region(struct address_space *mapping, struct writeback_control *wbc, loff_t start, loff_t end, loff_t *_next) { - struct folio_batch fbatch; + struct folio *folio; + ssize_t ret; int skips = 0; - folio_batch_init(&fbatch); do { - int nr; pgoff_t index = start / PAGE_SIZE; - nr = filemap_get_folios_tag(mapping, &index, end / PAGE_SIZE, - PAGECACHE_TAG_DIRTY, &fbatch); - if (!nr) + folio = filemap_get_folio_tag(mapping, &index, end / PAGE_SIZE, + PAGECACHE_TAG_DIRTY); + if (!folio) break; - for (int i = 0; i < nr; i++) { - ssize_t ret; - struct folio *folio = fbatch.folios[i]; - -redo_folio: - start = folio_pos(folio); /* May regress with THPs */ + start = folio_pos(folio); /* May regress with THPs */ - /* At this point we hold neither the i_pages lock nor the - * page lock: the page may be truncated or invalidated - * (changing page->mapping to NULL), or even swizzled - * back from swapper_space to tmpfs file mapping - */ - if (wbc->sync_mode != WB_SYNC_NONE) { - ret = folio_lock_killable(folio); - if (ret < 0) - goto write_error; - } else { - if (!folio_trylock(folio)) - goto skip_write; + /* At this point we hold neither the i_pages lock nor the + * page lock: the page may be truncated or invalidated + * (changing page->mapping to NULL), or even swizzled + * back from swapper_space to tmpfs file mapping + */ + if (wbc->sync_mode != WB_SYNC_NONE) { + ret = folio_lock_killable(folio); + if (ret < 0) { + folio_put(folio); + return ret; } - - if (folio_mapping(folio) != mapping || - !folio_test_dirty(folio)) { - start += folio_size(folio); - folio_unlock(folio); - continue; + } else { + if (!folio_trylock(folio)) { + folio_put(folio); + return 0; } + } - if (folio_test_writeback(folio) || - folio_test_fscache(folio)) { - folio_unlock(folio); - if (wbc->sync_mode == WB_SYNC_NONE) - goto skip_write; + if (folio_mapping(folio) != mapping || + !folio_test_dirty(folio)) { + start += folio_size(folio); + folio_unlock(folio); + folio_put(folio); + continue; + } + if (folio_test_writeback(folio) || + folio_test_fscache(folio)) { + folio_unlock(folio); + if (wbc->sync_mode != WB_SYNC_NONE) { folio_wait_writeback(folio); #ifdef CONFIG_CIFS_FSCACHE folio_wait_fscache(folio); #endif - goto redo_folio; + } else { + start += folio_size(folio); } - - if (!folio_clear_dirty_for_io(folio)) - /* We hold the page lock - it should've been dirty. */ - WARN_ON(1); - - ret = cifs_write_back_from_locked_folio(mapping, wbc, folio, start, end); - if (ret < 0) - goto write_error; - - start += ret; - continue; - -write_error: - folio_batch_release(&fbatch); - *_next = start; - return ret; - -skip_write: - /* - * Too many skipped writes, or need to reschedule? - * Treat it as a write error without an error code. - */ - if (skips >= 5 || need_resched()) { - ret = 0; - goto write_error; + folio_put(folio); + if (wbc->sync_mode == WB_SYNC_NONE) { + if (skips >= 5 || need_resched()) + break; + skips++; } - - /* Otherwise, just skip that folio and go on to the next */ - skips++; - start += folio_size(folio); continue; } - folio_batch_release(&fbatch); + if (!folio_clear_dirty_for_io(folio)) + /* We hold the page lock - it should've been dirty. */ + WARN_ON(1); + + ret = cifs_write_back_from_locked_folio(mapping, wbc, folio, start, end); + folio_put(folio); + if (ret < 0) + return ret; + + start += ret; cond_resched(); } while (wbc->nr_to_write > 0);