Skip to contentSkip to conversation

cls_cgroup: remove unneeded cgroup_lock

PATCH Applied [email protected] 2 participants 2 messages May 12, 2009 – May 17, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 cls_cgroup: remove unneeded cgroup_lock

From: Li Zefan <[email protected]>

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 file changed, 6 deletions(-)
net/sched/cls_cgroup.c renamed from net/sched/cls_cgroup.c~cls_cgroup-remove-unneeded-cgroup_lock +0 -6
diff -puN net/sched/cls_cgroup.c~cls_cgroup-remove-unneeded-cgroup_lock net/sched/cls_cgroup.c
@@ -62,13 +62,7 @@ static u64 read_classid(struct cgroup *c
 
 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;
 }
 

_