From: David Howells <dhowells@redhat.com>
To: Christian Brauner <christian@brauner.io>
Cc: David Howells <dhowells@redhat.com>,
Paulo Alcantara <pc@manguebit.com>,
Max Kellermann <max.kellermann@ionos.com>,
netfs@lists.linux.dev, 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-kernel@vger.kernel.org
Subject: [PATCH 06/11] fs/netfs: reorder struct fields to eliminate holes
Date: Mon, 19 May 2025 14:48:02 +0100 [thread overview]
Message-ID: <20250519134813.2975312-7-dhowells@redhat.com> (raw)
In-Reply-To: <20250519134813.2975312-1-dhowells@redhat.com>
From: Max Kellermann <max.kellermann@ionos.com>
This shrinks `struct netfs_io_stream` from 104 to 96 bytes and `struct
netfs_io_request` from 600 to 576 bytes.
[DH: Modified as the patch to turn netfs_io_request::error into a short
was removed from the set]
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Paulo Alcantara <pc@manguebit.com>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
---
include/linux/netfs.h | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/include/linux/netfs.h b/include/linux/netfs.h
index 73537dafa224..33f145f7f2c2 100644
--- a/include/linux/netfs.h
+++ b/include/linux/netfs.h
@@ -144,8 +144,8 @@ struct netfs_io_stream {
struct netfs_io_subrequest *front; /* Op being collected */
unsigned long long collected_to; /* Position we've collected results to */
size_t transferred; /* The amount transferred from this stream */
- enum netfs_io_source source; /* Where to read from/write to */
unsigned short error; /* Aggregate error for the stream */
+ enum netfs_io_source source; /* Where to read from/write to */
unsigned char stream_nr; /* Index of stream in parent table */
bool avail; /* T if stream is available */
bool active; /* T if stream is active */
@@ -240,19 +240,10 @@ struct netfs_io_request {
void *netfs_priv; /* Private data for the netfs */
void *netfs_priv2; /* Private data for the netfs */
struct bio_vec *direct_bv; /* DIO buffer list (when handling iovec-iter) */
- unsigned int direct_bv_count; /* Number of elements in direct_bv[] */
- unsigned int debug_id;
- unsigned int rsize; /* Maximum read size (0 for none) */
- unsigned int wsize; /* Maximum write size (0 for none) */
- atomic_t subreq_counter; /* Next subreq->debug_index */
- unsigned int nr_group_rel; /* Number of refs to release on ->group */
- spinlock_t lock; /* Lock for queuing subreqs */
unsigned long long submitted; /* Amount submitted for I/O so far */
unsigned long long len; /* Length of the request */
size_t transferred; /* Amount to be indicated as transferred */
long error; /* 0 or error that occurred */
- enum netfs_io_origin origin; /* Origin of the request */
- bool direct_bv_unpin; /* T if direct_bv[] must be unpinned */
unsigned long long i_size; /* Size of the file */
unsigned long long start; /* Start position */
atomic64_t issued_to; /* Write issuer folio cursor */
@@ -260,7 +251,16 @@ struct netfs_io_request {
unsigned long long cleaned_to; /* Position we've cleaned folios to */
unsigned long long abandon_to; /* Position to abandon folios to */
pgoff_t no_unlock_folio; /* Don't unlock this folio after read */
+ unsigned int direct_bv_count; /* Number of elements in direct_bv[] */
+ unsigned int debug_id;
+ unsigned int rsize; /* Maximum read size (0 for none) */
+ unsigned int wsize; /* Maximum write size (0 for none) */
+ atomic_t subreq_counter; /* Next subreq->debug_index */
+ unsigned int nr_group_rel; /* Number of refs to release on ->group */
+ spinlock_t lock; /* Lock for queuing subreqs */
unsigned char front_folio_order; /* Order (size) of front folio */
+ enum netfs_io_origin origin; /* Origin of the request */
+ bool direct_bv_unpin; /* T if direct_bv[] must be unpinned */
refcount_t ref;
unsigned long flags;
#define NETFS_RREQ_OFFLOAD_COLLECTION 0 /* Offload collection to workqueue */
next prev parent reply other threads:[~2025-05-19 13:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-19 13:47 [PATCH 00/11] netfs: Miscellaneous cleanups David Howells
2025-05-19 13:47 ` [PATCH 01/11] netfs: Update main API document David Howells
2025-05-19 13:47 ` [PATCH 02/11] fs/netfs: remove unused flag NETFS_SREQ_SEEK_DATA_READ David Howells
2025-05-19 13:47 ` [PATCH 03/11] fs/netfs: remove unused source NETFS_INVALID_WRITE David Howells
2025-05-19 13:48 ` [PATCH 04/11] fs/netfs: remove unused flag NETFS_ICTX_WRITETHROUGH David Howells
2025-05-19 13:48 ` [PATCH 05/11] fs/netfs: remove unused enum choice NETFS_READ_HOLE_CLEAR David Howells
2025-05-19 13:48 ` David Howells [this message]
2025-05-19 13:48 ` [PATCH 07/11] fs/netfs: remove `netfs_io_request.ractl` David Howells
2025-05-19 13:48 ` [PATCH 08/11] fs/netfs: declare field `proc_link` only if CONFIG_PROC_FS=y David Howells
2025-05-19 13:48 ` [PATCH 09/11] folio_queue: remove unused field `marks3` David Howells
2025-05-19 13:48 ` [PATCH 10/11] fs/netfs: remove unused flag NETFS_RREQ_DONT_UNLOCK_FOLIOS David Howells
2025-05-19 13:48 ` [PATCH 11/11] fs/netfs: remove unused flag NETFS_RREQ_BLOCKED David Howells
2025-05-20 11:20 ` [PATCH 00/11] netfs: Miscellaneous cleanups Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250519134813.2975312-7-dhowells@redhat.com \
--to=dhowells@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=christian@brauner.io \
--cc=linux-afs@lists.infradead.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=max.kellermann@ionos.com \
--cc=netfs@lists.linux.dev \
--cc=pc@manguebit.com \
--cc=v9fs@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).