Message ID | 20231013160423.2218093-5-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 5888FCDB47E for <linux-mm@archiver.kernel.org>; Fri, 13 Oct 2023 16:04:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E3E016B00A2; Fri, 13 Oct 2023 12:04:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DED386B00A4; Fri, 13 Oct 2023 12:04:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB6146B00A9; Fri, 13 Oct 2023 12:04:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id BB2206B00A2 for <linux-mm@kvack.org>; Fri, 13 Oct 2023 12:04:49 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3B07480306 for <linux-mm@kvack.org>; Fri, 13 Oct 2023 16:04:49 +0000 (UTC) X-FDA: 81340911498.02.856DD3B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf06.hostedemail.com (Postfix) with ESMTP id 68C3118001E for <linux-mm@kvack.org>; Fri, 13 Oct 2023 16:04:47 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Q6YzsoWy; spf=pass (imf06.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.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=1697213087; 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=gcj4568/Cja75cJgRJVpO1Pa05t3rY5GzidcrAxRiJc=; b=pr4gr6LOQWBFi/izOySd1/6reOSDWxUw3TdGayK4HgjsJw0388uZ+cNYZLV69kvD2QlNXz 4sfKnjkubSvRMjig+H0K5t9h09DNBQpz/UaAjDbh9/gCvuGIAwSu4jQ2myT93gXEt1heqm i/TVYTn2vMOBZN0WotBtpyyLN783Fpc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697213087; a=rsa-sha256; cv=none; b=MDL/244woy3qW6q5xGO5iP9gd0XtFNnIq8Uz9tsYzOIU7BwiICrT7zA882BYwJCan45xey UCyAfUOqZKF9eSA8/2BI4tyD7i3sEgO3GpjVWW4PJ+tHwIOKlC9xvf2804+BQVKG3zBrst uGWSxkS5Qf9wTTBZWMB9YDemPRp5cYY= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Q6YzsoWy; spf=pass (imf06.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.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=1697213086; 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=gcj4568/Cja75cJgRJVpO1Pa05t3rY5GzidcrAxRiJc=; b=Q6YzsoWyj+TpRSwSKxEPkpYkRzk+JH6wEb0RpzMHiwzu0xjuXvW8gBnUj5zot5pK2LbIrt gQB5ZUd0a00RzcOGx5zpiPmmFgkbZmB97z56AmdBJn77HxfYfyrFNjDFqTklk4HCMj5sUx Hr3Z84OiADmZemXaQwj6LWGQcaf7zYI= Received: from mimecast-mx02.redhat.com (mx-ext.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-637-7pwZptOZM4Gupdab9T4_0w-1; Fri, 13 Oct 2023 12:04:42 -0400 X-MC-Unique: 7pwZptOZM4Gupdab9T4_0w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 16FBB2810D7B; Fri, 13 Oct 2023 16:04:41 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90FC92157F5A; Fri, 13 Oct 2023 16:04:38 +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>, Ilya Dryomov <idryomov@gmail.com>, Christian Brauner <christian@brauner.io>, 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, linux-cachefs@redhat.com Subject: [RFC PATCH 04/53] netfs: Allow the netfs to make the io (sub)request alloc larger Date: Fri, 13 Oct 2023 17:03:33 +0100 Message-ID: <20231013160423.2218093-5-dhowells@redhat.com> In-Reply-To: <20231013160423.2218093-1-dhowells@redhat.com> References: <20231013160423.2218093-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Rspamd-Queue-Id: 68C3118001E X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: o7bhbz7ozw4anqqgpw7r7zikgtkcfe45 X-HE-Tag: 1697213087-522349 X-HE-Meta: U2FsdGVkX1/Ir6OQGEGN6AzPFJ0IQBjyIn7HjCyliRGdWrNGpE+yFaRUnD1XZqOF1ulUgArneQZuteD+0TqZOO8jPyVTbSBVc3ycEnnjc6+WXMwJv/Qsijn5rhlb4qLZWAOX4WhIYOr5w+bdMN0Vd3Ns4IdJ5gZmWlISLkdPegv9zMQbNJdxVf9QTa6cDGQcctMF0La0dEdlgmvK7Vmo4fz3iKUtwxovdHeh1HujymcODTOFwJ11u50URjR8hDAGYleFwfGcstN6GY0dYnPGAzJmzGO0IH5iWbTxFzfxV/8SpuPskZoB4psssLSzS4+WE9C8tmu3jLZXJ/y2qlolUBJenXRLd5mRLoJywmqCOS8UVwefWeriGK0fHv16Hy3H9exGPFi/3BBirPxdgbltGrV6Wj4gnqzKnzmVorzTwzqwegB1huMlP9Py8KqFf8ommuaQ3GeY1sTbHEUgg8MjLPFhHtYnCe9ASaJM7+LJyisLeYqWGQwqmWo9gzFmX+/x03dU4arwFvLU93UH1JHivXZlAL1EEA9DdPXNIIYvQQHX49LxP1AK849YCP6hPTRsfdETlhMotvRDNBx+xeBdydflLIeEhBTnBvam68F3Oe2fdrNftgJQ6PfiuS31SbWkEujLwBEsJz5/CoOS7RAyvnEplZeg5nUqnitf7NzUQvl66Ot/QFGsEKnILfgcu5dQYQspfUIsGSmo06Rn70HRCSngsSK1ubbXV7horG1DdM/eA71FtOA4zRstLmiWGu7uFaotnqn78yXBfUBxW7+EOLgMuyxgnsSt2AtopqLIzaM3P64/GxKdzfGuqK3tK1IVtK0U8dkZo0m80h/qNsaHbmGr8YAdnbbXpG0MvH2Oje2AsKjm3dfo34hfB5YXCosqtvJrMUyzNhu3fYmnuEK5jDgIaZ2uezlRDkrk3qDIQL2fd3+ZHEaASj9tj3nUI4UwbZlsxv0Qc9dBYn3g/UT snxiGG3z n/G3klUXDC2y8c3rQvsISxiDEQMDcFqdZGSgaztxBiTnB2iEwj0NQyVNZmgMLb3T530FYJ6BsjIWXa8ZJucgq0tI/RXapPFItovDNHNp9q4JckimasArSW+p7U/5Js+rdCaPguPvPfbHhnkiRhf8ndkmHfIRUZbeyrIIiLpB9UhsgX0D+47ZABYP/7vH/wniS7RkbiHLeUqcZ9b7EvNbcertwfC/jG10dfisAieJZh0kmqNYTjBEhOLc1bolcoWG/Hx4Lvb4YuuVLgXwsY/sCVKfxCdV0fXsmwx0Uu587K8WQA7Y= 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> |
Series |
netfs, afs, cifs: Delegate high-level I/O to netfslib
|
expand
|
diff --git a/fs/netfs/objects.c b/fs/netfs/objects.c index e41f9fc9bdd2..2f1865ff7cce 100644 --- a/fs/netfs/objects.c +++ b/fs/netfs/objects.c @@ -22,7 +22,8 @@ struct netfs_io_request *netfs_alloc_request(struct address_space *mapping, struct netfs_io_request *rreq; int ret; - rreq = kzalloc(sizeof(struct netfs_io_request), GFP_KERNEL); + rreq = kzalloc(ctx->ops->io_request_size ?: sizeof(struct netfs_io_request), + GFP_KERNEL); if (!rreq) return ERR_PTR(-ENOMEM); @@ -116,7 +117,9 @@ struct netfs_io_subrequest *netfs_alloc_subrequest(struct netfs_io_request *rreq { struct netfs_io_subrequest *subreq; - subreq = kzalloc(sizeof(struct netfs_io_subrequest), GFP_KERNEL); + subreq = kzalloc(rreq->netfs_ops->io_subrequest_size ?: + sizeof(struct netfs_io_subrequest), + GFP_KERNEL); if (subreq) { INIT_LIST_HEAD(&subreq->rreq_link); refcount_set(&subreq->ref, 2); diff --git a/include/linux/netfs.h b/include/linux/netfs.h index b92e982ac4a0..6942b8cf03dc 100644 --- a/include/linux/netfs.h +++ b/include/linux/netfs.h @@ -214,6 +214,8 @@ struct netfs_io_request { * Operations the network filesystem can/must provide to the helpers. */ struct netfs_request_ops { + unsigned int io_request_size; /* Alloc size for netfs_io_request struct */ + unsigned int io_subrequest_size; /* Alloc size for netfs_io_subrequest struct */ int (*init_request)(struct netfs_io_request *rreq, struct file *file); void (*free_request)(struct netfs_io_request *rreq); int (*begin_cache_operation)(struct netfs_io_request *rreq);
Allow the network filesystem to specify extra space to be allocated on the end of the io (sub)request. This allows cifs, for example, to use this space rather than allocating its own cifs_readdata struct. 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/objects.c | 7 +++++-- include/linux/netfs.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-)