[Devel] [PATCH 2/4] cgroup freezer: Avoid lazy state changes when convenient

Matt Helsley matthltc at us.ibm.com
Wed Jun 3 02:31:19 PDT 2009


 When all the tasks of a cgroup were successfully frozen we can avoid
 the lazy FREEZING -> FROZEN transition and move into FROZEN during the
 write to freezer.state.

Signed-off-by: Matt Helsley <matthltc at us.ibm.com>
---
 kernel/cgroup_freezer.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index 765e2c1..19702ac 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -286,7 +286,10 @@ static int try_to_freeze_cgroup(struct cgroup *cgroup, struct freezer *freezer)
 	}
 	cgroup_iter_end(cgroup, &it);
 
-	return num_cant_freeze_now ? -EBUSY : 0;
+	if (num_cant_freeze_now)
+		return -EBUSY;
+	freezer->state = CGROUP_FROZEN;
+	return 0;
 }
 
 static void unfreeze_cgroup(struct cgroup *cgroup, struct freezer *freezer)
-- 
1.5.6.3


_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list