cls_cgroup: remove unneeded cgroup_lock
Subsystems (3)
PATCH 1/1 cls_cgroup: remove unneeded cgroup_lock
We can remove this lock here, since we are in cgroup write handler and thus the cgrp is guaranteed to be valid, and no lock is needed when writing a u32 variable.
--- net/sched/cls_cgroup.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
net/sched/cls_cgroup.c +0 -6
@@ -62,13 +62,7 @@ static u64 read_classid(struct cgroup *cgrp, struct cftype *cft)static int write_classid (struct cgroup *cgrp,struct cftype *cft,u64 value) { -if (!cgroup_lock_live_group (cgrp)) -return -ENODEV ; -cgrp_cls_state (cgrp)->classid = (u32 ) value; - -cgroup_unlock (); -return 0 ; }
Signature · 1 line
1.5.4.rc3
A message that is not in the archive (sent off-list or not yet received): [email protected]
Paul Menage
Acked-byQuoted 3 lines · Li Zefan
We can remove this lock here, since we are in cgroup write handler and thus the cgrp is guaranteed to be valid, and no lock is needed when writing a u32 variable.
There's no guarantee that the group isn't dead, so we could be writing into a value that's never going to be used again, but I guess that's not really a big deal.
Quoted 28 lines
Signed-off-by Li Zefan <[email protected]>--- net/sched/cls_cgroup.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)net/sched/cls_cgroup.c +0
-7@@ -62,13 +62,7 @@ static u64 read_classid(struct cgroup *cgrp, struct cftype *cft)static int write_classid (struct cgroup *cgrp,struct cftype *cft,u64 value) { -if (!cgroup_lock_live_group (cgrp)) -return -ENODEV ; -cgrp_cls_state (cgrp)->classid = (u32 ) value; - -cgroup_unlock (); -return 0 ; } --1.5.4.rc3
Quoted 3 lines · Li Zefan
We can remove this lock here, since we are in cgroup write handler and thus the cgrp is guaranteed to be valid, and no lock is needed when writing a u32 variable.
There's no guarantee that the group isn't dead, so we could be writing into a value that's never going to be used again, but I guess that's not really a big deal.
Quoted 28 lines
Signed-off-by Li Zefan <[email protected]>--- net/sched/cls_cgroup.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)net/sched/cls_cgroup.c +0
-7@@ -62,13 +62,7 @@ static u64 read_classid(struct cgroup *cgrp, struct cftype *cft)static int write_classid (struct cgroup *cgrp,struct cftype *cft,u64 value) { -if (!cgroup_lock_live_group (cgrp)) -return -ENODEV ; -cgrp_cls_state (cgrp)->classid = (u32 ) value; - -cgroup_unlock (); -return 0 ; } --1.5.4.rc3