cgroup: make flags and subsys_masks unsigned int

There's no reason to use atomic bitops for cgroup_subsys_state->flags,
cgroup_root->flags and various subsys_masks.  This patch updates those
to use bitwise and/or operations instead and converts them form
unsigned long to unsigned int.

This makes the fields occupy (marginally) smaller space and makes it
clear that they don't require atomicity.

This patch doesn't cause any behavior difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
This commit is contained in:
Tejun Heo
2014-05-04 15:09:13 -04:00
parent ed3d261b53
commit 69dfa00ccb
2 changed files with 22 additions and 23 deletions

View File

@@ -62,7 +62,7 @@ struct cgroup_subsys_state {
/* the parent css */
struct cgroup_subsys_state *parent;
unsigned long flags;
unsigned int flags;
/* percpu_ref killing and RCU release */
struct rcu_head rcu_head;
@@ -185,7 +185,7 @@ struct cgroup {
u64 serial_nr;
/* the bitmask of subsystems enabled on the child cgroups */
unsigned long child_subsys_mask;
unsigned int child_subsys_mask;
/* Private pointers for each registered subsystem */
struct cgroup_subsys_state __rcu *subsys[CGROUP_SUBSYS_COUNT];
@@ -312,7 +312,7 @@ struct cgroup_root {
struct kernfs_root *kf_root;
/* The bitmask of subsystems attached to this hierarchy */
unsigned long subsys_mask;
unsigned int subsys_mask;
/* Unique id for this hierarchy. */
int hierarchy_id;
@@ -327,7 +327,7 @@ struct cgroup_root {
struct list_head root_list;
/* Hierarchy-specific flags */
unsigned long flags;
unsigned int flags;
/* IDs for cgroups in this hierarchy */
struct idr cgroup_idr;