[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211004084928.17622-2-richard.weiyang@gmail.com>
Date: Mon, 4 Oct 2021 08:49:26 +0000
From: Wei Yang <richard.weiyang@...il.com>
To: tj@...nel.org, lizefan.x@...edance.com, hannes@...xchg.org
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
Wei Yang <richard.weiyang@...il.com>
Subject: [PATCH 2/4] cgroup: reorder cgroup_subsys fields to save 8 byte
On 64bit platform, struct is aligned by 8 bytes by default.
By moving cgroup_subsys.depends_on, we fit these adjacent fields into
8 bytes alignment.
Signed-off-by: Wei Yang <richard.weiyang@...il.com>
---
include/linux/cgroup-defs.h | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
index f6d80896daab..4649d09396fd 100644
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -672,6 +672,15 @@ struct cgroup_subsys {
*/
bool threaded:1;
+ /*
+ * A subsystem may depend on other subsystems. When such subsystem
+ * is enabled on a cgroup, the depended-upon subsystems are enabled
+ * together if available. Subsystems enabled due to dependency are
+ * not visible to userland until explicitly enabled. The following
+ * specifies the mask of subsystems that this one depends on.
+ */
+ u16 depends_on;
+
/* the following two fields are initialized automatically during boot */
int id;
const char *name;
@@ -698,14 +707,6 @@ struct cgroup_subsys {
struct cftype *dfl_cftypes; /* for the default hierarchy */
struct cftype *legacy_cftypes; /* for the legacy hierarchies */
- /*
- * A subsystem may depend on other subsystems. When such subsystem
- * is enabled on a cgroup, the depended-upon subsystems are enabled
- * together if available. Subsystems enabled due to dependency are
- * not visible to userland until explicitly enabled. The following
- * specifies the mask of subsystems that this one depends on.
- */
- u16 depends_on;
};
extern struct percpu_rw_semaphore cgroup_threadgroup_rwsem;
--
2.23.0
Powered by blists - more mailing lists