diff options
author | Todd Poynor <toddpoynor@google.com> | 2017-04-06 18:47:57 -0700 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2017-04-11 09:06:17 +0900 |
commit | b8b1a2e5eca6bbf20e3a29c5f9db8331ec52af2d (patch) | |
tree | 1f64f1e97e59af97c7322df5703184032d28b2cd /include/linux/cgroup-defs.h | |
parent | 30e03acda5fd9c77ec9bf8b3c5def9540c6b0486 (diff) | |
download | lwn-b8b1a2e5eca6bbf20e3a29c5f9db8331ec52af2d.tar.gz lwn-b8b1a2e5eca6bbf20e3a29c5f9db8331ec52af2d.zip |
cgroup: move cgroup_subsys_state parent field for cache locality
Various structures embed a struct cgroup_subsys_state, typically at
the top of the containing structure. It is common for code that
accesses the structures to perform operations that iterate over the
chain of parent css pointers, also accessing data in each containing
structure. In particular, struct cpuacct is used by fairly hot code
paths in the scheduler such as cpuacct_charge().
Move the parent css pointer field to the end of the structure to
increase the chances of residing in the same cache line as the data
from the containing structure.
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/cgroup-defs.h')
-rw-r--r-- | include/linux/cgroup-defs.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index c74b78ecd583..21745946cae1 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -107,9 +107,6 @@ struct cgroup_subsys_state { /* reference count - access via css_[try]get() and css_put() */ struct percpu_ref refcnt; - /* PI: the parent css */ - struct cgroup_subsys_state *parent; - /* siblings list anchored at the parent's ->children */ struct list_head sibling; struct list_head children; @@ -139,6 +136,12 @@ struct cgroup_subsys_state { /* percpu_ref killing and RCU release */ struct rcu_head rcu_head; struct work_struct destroy_work; + + /* + * PI: the parent css. Placed here for cache proximity to following + * fields of the containing structure. + */ + struct cgroup_subsys_state *parent; }; /* |