Message ID | 20231213152350.431591-28-dhowells@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 633B1C4167B for <linux-mm@archiver.kernel.org>; Wed, 13 Dec 2023 15:26:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E814E6B03CB; Wed, 13 Dec 2023 10:26:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E33C96B03CE; Wed, 13 Dec 2023 10:26:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD1AD6B03D0; Wed, 13 Dec 2023 10:26:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id BD4AC6B03CB for <linux-mm@kvack.org>; Wed, 13 Dec 2023 10:26:22 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 9A70C1C14F0 for <linux-mm@kvack.org>; Wed, 13 Dec 2023 15:26:22 +0000 (UTC) X-FDA: 81562171404.13.A6B3D83 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf16.hostedemail.com (Postfix) with ESMTP id EF25B18002C for <linux-mm@kvack.org>; Wed, 13 Dec 2023 15:26:20 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=e7r3PqB2; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.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=1702481181; 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=KbBg4oLyg/4VjucqWLPnAUrUGVI7xibirsiFMNrNygw=; b=yZ9L7nCkUTa0n5KZnNMUl8ZMZB9UoU25iOMkEqUCyETJZAj+iNrsgfxQpuZM0c0XCUnYRe pkBFF5r5FFxz5lCuT79zyn5i7Ri/IEA93w/T462jM8j6njNycfBb/MfgRCR1K62NS1X2Tc gBJlrushaeD2reZf6bfTEmXmSEnPKmI= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=e7r3PqB2; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.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=1702481181; a=rsa-sha256; cv=none; b=i5ho5JUXlpcdS8PnYVaeA3aT9AZGeLdQqSbKRpLHM+LJMM0XhzuJJba36s/R4yRu53sA39 zcmDQO5wbhhJtGq2jeJXbOpeTiIBX+i/hIS3jq2BkrQ4ef9d4gzcbtZPSQP967tfosL+02 18HHS87Hc17xLu7h3s6PDq2UJDfU4kU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702481180; 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=KbBg4oLyg/4VjucqWLPnAUrUGVI7xibirsiFMNrNygw=; b=e7r3PqB2vAv8B2rswgc1BUQ+c/EHWz8K6LVhVxYc6pEmwZK8ndjW1R7zR8a7Fq0srSrslG VUmU+K85t8R92UjmaRuTTV+S1qzPEC4tS5j5Pu2izjPF/hHov5vPsZCEIYKAhQ7LTwLcYR HRlXHiXWS2wRZVha5SJ2SSqD3Gt58GY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-16-K1t_OTENORi1A-IFlHrJWg-1; Wed, 13 Dec 2023 10:25:59 -0500 X-MC-Unique: K1t_OTENORi1A-IFlHrJWg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 797C53811F42; Wed, 13 Dec 2023 15:25:50 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD51451E3; Wed, 13 Dec 2023 15:25:46 +0000 (UTC) From: David Howells <dhowells@redhat.com> To: Jeff Layton <jlayton@kernel.org>, Steve French <smfrench@gmail.com> Cc: David Howells <dhowells@redhat.com>, Matthew Wilcox <willy@infradead.org>, Marc Dionne <marc.dionne@auristor.com>, Paulo Alcantara <pc@manguebit.com>, Shyam Prasad N <sprasad@microsoft.com>, Tom Talpey <tom@talpey.com>, Dominique Martinet <asmadeus@codewreck.org>, Eric Van Hensbergen <ericvh@kernel.org>, Ilya Dryomov <idryomov@gmail.com>, Christian Brauner <christian@brauner.io>, linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 27/39] netfs: Allocate multipage folios in the writepath Date: Wed, 13 Dec 2023 15:23:37 +0000 Message-ID: <20231213152350.431591-28-dhowells@redhat.com> In-Reply-To: <20231213152350.431591-1-dhowells@redhat.com> References: <20231213152350.431591-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Rspamd-Queue-Id: EF25B18002C X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: cmr37o3q167w6gqkxr7sxnubmwqebmi4 X-HE-Tag: 1702481180-935858 X-HE-Meta: U2FsdGVkX19M1QygElZC93muGfSRBB9dSjhyxJ/jU8nNKG1y+RUWFs0ZMrDuoDZmFm/HY78Gr5i/Z/aOq59Q6xTlHDmk9xHMhiZe2uTaIDQLKhnRqj68C4PpTmIcdEgGi4By0ZnjWFhQiwXD8d0EhLhCIwcBx6ix4vJ8+lahaRTDYbuCZWTt2AQ+s7S6tzfUr7gtl1qV/Og3bsB45o7LXmPJ0jNslzPWp8Lf9Wpp+3fuITUgiWsapQ5NT5oRFzn6EyFy6D4E0daF89SK+S7jAHjWVnsTVRLTs8a6NteU3WEIvXEMuHQgAHwVmP1kf2Mh5MyERuxj9zshXw35VJ/xSjqgb5EZNnZlT2jYdBk9gOJ73oYE+gfJjPFURQ7ak0ckya9/bfTObhewvf/jwEej02VBnC7Py4wRMuQ6DmoYrj/HsGxKxwpjJ6k+sZqr1YlCPW6d0ABU5x8WZ1/ujpZq2nT75J9rsA71p4WyFQgfLigygfcRA8brvSJm3Lor54vywV3Jch90s5tuhsTNmhKpZTTqYa1HxMUWWtW/z/V64UR83rx65QC05ICtnlUIy/pagKDjyU153udvXn9YZ9S6una2WuEpIahZMdUKQylzWiTHRvkaKJN5OAjhjPRDzhSomg/GP2mQZjrcDKuG+2FfzKoFCwePVPf38nMjPbu7lkAd/50bIjJh42X613Vg0NXzKCpmCFbAzOoberLrGBhDEKpcSwZZ/YLOT6SzA27hW+iUO7vBL7rYUzwcQ8qvI0if6jzetOo3/ptJfJAzhkHhPcs/bEm+w4uEDM4NzAcWrbxPNKOQfBuVxBFxS0D1clvvvJyS8mhbto6OC6yaRPpQGkqJd6QbTuiaNRDe8GawkotkRSYfFEzY2a+7Z33lnAyAzMudTxdCeVgdfyE0A50lbWsgzEaPCawh4CHo9KL2eMdQkbSF9eFvyJmjovIsoD/dPHLNC7S4ewWY1UT1qN+ Q2gApLae k41sNW9pwyQtzmIW43cgzz0DKvkdPehaPuz/UVTLuPie8Pnt69dRLE5c+SoPk4WJERQZ33Fr8zQ+u4PPKSv9LnGHO+PVBJNtuOGuUhddbVx7LnUuxsugylYxIdb7NuVIScd/id+vu6ic9ih5piMUnJt/RSG0QFWhRQaCYSVteT6iiifeLM9siF6quircxZKN/G/b9Um4vIbZw487shk7y88quP7C9PHDUrHB+998aZ/0+z/zI2hTbH+EN92u2V5tXQICB2x1TIHJ51CCfRwhY07ev2ZF3ky8nzFPz 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
netfs, afs, 9p: Delegate high-level I/O to netfslib
|
expand
|
diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c index 6e7f06d9962d..b76688e98f81 100644 --- a/fs/netfs/buffered_write.c +++ b/fs/netfs/buffered_write.c @@ -84,14 +84,19 @@ static enum netfs_how_to_modify netfs_how_to_modify(struct netfs_inode *ctx, } /* - * Grab a folio for writing and lock it. + * Grab a folio for writing and lock it. Attempt to allocate as large a folio + * as possible to hold as much of the remaining length as possible in one go. */ static struct folio *netfs_grab_folio_for_write(struct address_space *mapping, loff_t pos, size_t part) { pgoff_t index = pos / PAGE_SIZE; + fgf_t fgp_flags = FGP_WRITEBEGIN; - return __filemap_get_folio(mapping, index, FGP_WRITEBEGIN, + if (mapping_large_folio_support(mapping)) + fgp_flags |= fgf_set_order(pos % PAGE_SIZE + part); + + return __filemap_get_folio(mapping, index, fgp_flags, mapping_gfp_mask(mapping)); }
Allocate a multipage folio when copying data into the pagecache if possible if there's sufficient data to warrant it. Signed-off-by: David Howells <dhowells@redhat.com> cc: Jeff Layton <jlayton@kernel.org> cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org --- fs/netfs/buffered_write.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)