Message ID | 20231207212206.1379128-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 199BAC4167B for <linux-mm@archiver.kernel.org>; Thu, 7 Dec 2023 21:24:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE78F6B00BF; Thu, 7 Dec 2023 16:24:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D975E6B00C0; Thu, 7 Dec 2023 16:24:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C12AB6B00C1; Thu, 7 Dec 2023 16:24:05 -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 AA54F6B00BF for <linux-mm@kvack.org>; Thu, 7 Dec 2023 16:24:05 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8DB5540273 for <linux-mm@kvack.org>; Thu, 7 Dec 2023 21:24:05 +0000 (UTC) X-FDA: 81541300050.16.D4DED69 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 C6997C0018 for <linux-mm@kvack.org>; Thu, 7 Dec 2023 21:24:03 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="UIzl/hPX"; 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=1701984243; 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=Nh6r1hZYiDO4jHtNQeBHIkfv/idWwQaII9QHJ+nzj+mSHJT/CqxMnTn+vlY7ASIl+55+0X feGZo9WIOSYXdgsDIWwNDT/XZSrmI7KZpae/nr6S3d7ktcoq6OpZ7aTPtOjGdnQldgmSOt fWqB5qr51oVoy1OIJEAED30fsb2nY10= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701984243; a=rsa-sha256; cv=none; b=sCqTXBoAaYiqlT+mb3YNTXSDyDNeuAnpULlsuB/2/Z2R9cG3iBPQG6KuzkNVJW858nG6jg lnFrBuP3UxgWrOBSk2Gq13P5yJ3rZinX6cBQzCiOjK3PxRe75ZZfJq/iRIVy0/VcvHrjnO tcYWzcetV7rl5d49ckeN4V1dscSXKRs= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="UIzl/hPX"; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701984243; 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=UIzl/hPXF/LibREAKOMb8U3ayunczhbgEVo2bJiBX8PsgB8z4uP8QzHfMJNL5laHIxGa3d XhsuRmsO3i5OrRtsOm+ljjSStIPOdHWBwKBPcCbdONE7au1pjDARnoucSWYEabyMyp7qJJ RBx16MzChvtPfeJyPX5ZWsEaWLS7BMc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-64-QpeNj_4NMEmIciYa2Sj6iw-1; Thu, 07 Dec 2023 16:23:51 -0500 X-MC-Unique: QpeNj_4NMEmIciYa2Sj6iw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 2958A85A5B5; Thu, 7 Dec 2023 21:23:45 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A7CF492BC6; Thu, 7 Dec 2023 21:23:42 +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 v3 27/59] netfs: Allocate multipage folios in the writepath Date: Thu, 7 Dec 2023 21:21:34 +0000 Message-ID: <20231207212206.1379128-28-dhowells@redhat.com> In-Reply-To: <20231207212206.1379128-1-dhowells@redhat.com> References: <20231207212206.1379128-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Rspamd-Queue-Id: C6997C0018 X-Rspam-User: X-Stat-Signature: w9s6bmzicdtj5777b5dxbdixizfdurwj X-Rspamd-Server: rspam03 X-HE-Tag: 1701984243-838098 X-HE-Meta: U2FsdGVkX1/5bNhqdr0XKs2XDFS92dYiz4jukT5TprzV3njgJ0iB5WDs2CEYc1NtjUD/dtw4nYB3D4J8L0N0Meae9slq0WqWX9+02oeZD9xaIN/BkZ+XemT8pZJ3aabygG+9irE1SwFGrNLhnFlAQTS/wVPM40bUShiwuBpZjqt42foVtqXpQAH0sh2P2EasRGr0EwQGCfndUCf5DqhHF3jFCvdZCclHe9/XcJ//qrIVhSBKeJGm1LVCZ1so1AsZIlpzvfCAG3KROhEiqvEY+whib1CH03NGPzQzCNUYQDGHLP8pn72Y5Iy3wUAqcQhsiQVSs51vjuyuXXRWAvAlo3F2m8/AO5v+WAIxJVtMSUmBVD/XSTyyVwrnWXQRO1FlmN1IC/jcHVZNCeDxbk1ZTrQXSYVhEp8SNN28P5V06uK5SEmYXuqggqxraYXhJ5jPpIXIywGzPSxYYSSH0089mlWKEH5mG71JJtk19gMCNnze3C6ZTHyqSJUW58uddbEN8QlF5LuChAB25vAQ2NBKWGUnr4zV0hmqFME+Atf+b1Lx5ryIrSeHZBh9MrikmW2qXrU6uTYNe1hIWnuC/Hh7alLeZr8kbUZGSkOprPV34FQCBq+5boEW6lBdnq5HnfVejHBbXipwxRivLJ89D0NCBHjcmm9FyAwxBEdF3t7iFrS4skI6+pegPK07twE43OWqrlv9VcSO53PaBoDYe7P2KGMhXLHRoYLZphuBUwB0pqebuIipBn/n4AVkL+mQOWpvThsKq5v9wZdFQa7f1G09MrQPKhZXHnyWWtMosDaELO3SlhT0YESJogoOMLfDvE4YfPupuhUkP/pFNLLfa0sTz86xAylcu1T6YCrARvy0IDWz22Q0mAl7WNIU/512V/TUVHq5Sr1pi+tQd9MbqTd/YdJvb72GGqfaf+//w1d1bcpSTA4Aiw3Z4wACshD4PRXTx4Ciwt0aeSEF6C3nxCM GX+sRdG6 pGTr65VuSmPa9m6KYsm9df+pBBziEh0CbstId9+MPjNVY7B0tol40lna6o9DirKMdpOx7RfDnJMl4UL0LZsJg8EnK2kN1lQMlQ8jy52qmWEz9rkRnkTGEzS1rqpwS6yAGC8mD6rGgio6cboreRKYKtugcluyJCfrKeIt8P9cX+gKxRYeLsscvFNPWDfH79fFh2EXh1On1tFMOXOVCfK8KRvGxHJfeDaOx7O6b/4I8fh89GEJv2YvPsflCl552TxDSgK/n5ygaT8YGMgmec2NGy72Fa0Wu6Vk9Z/Ul 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, cifs: 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(-)