[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZZ7hwA18nfmFjYpj@slm.duckdns.org>
Date: Wed, 10 Jan 2024 08:28:16 -1000
From: Tejun Heo <tj@...nel.org>
To: gregkh@...uxfoundation.org
Cc: andrea.righi@...onical.com, ast@...nel.org,
linux-kernel@...r.kernel.org, geert@...ux-m68k.org
Subject: [PATCH v2 2/3] kernfs: Rearrange kernfs_node fields to reduce its
size on 64bit
From: Tejun Heo <tj@...nel.org>
Subject: kernfs: Rearrange kernfs_node fields to reduce its size on 64bit
Moving .flags and .mode right below .hash makes kernfs_node smaller by 8
bytes on 64bit. To avoid creating a hole from 8 bytes alignment on 32bit
archs, .priv is moved below so that there are two 32bit pointers after the
64bit .id field.
v2: Updated to avoid size increase on 32bit noticed by Geert.
Signed-off-by: Tejun Heo <tj@...nel.org>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
---
The third patch applies fine without update.
include/linux/kernfs.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/include/linux/kernfs.h
+++ b/include/linux/kernfs.h
@@ -206,22 +206,22 @@ struct kernfs_node {
const void *ns; /* namespace tag */
unsigned int hash; /* ns + name hash */
+ unsigned short flags;
+ umode_t mode;
+
union {
struct kernfs_elem_dir dir;
struct kernfs_elem_symlink symlink;
struct kernfs_elem_attr attr;
};
- void *priv;
-
/*
* 64bit unique ID. On 64bit ino setups, id is the ino. On 32bit,
* the low 32bits are ino and upper generation.
*/
u64 id;
- unsigned short flags;
- umode_t mode;
+ void *priv;
struct kernfs_iattrs *iattr;
};
Powered by blists - more mailing lists