Thread (63 messages) 63 messages, 7 authors, 2012-12-28

Re: [PATCH 5/7] cgroup_freezer: allow moving tasks in and out of a frozen cgroup

From: Oleg Nesterov <hidden>
Date: 2012-10-22 19:24:06
Also in: lkml

Tha last question ;)

On 10/16, Tejun Heo wrote:
quoted hunk ↗ jump to hunk
@@ -190,12 +201,12 @@ static void freezer_fork(struct task_struct *task)
 		goto out;

 	spin_lock_irq(&freezer->lock);
-	BUG_ON(freezer->state == CGROUP_FROZEN);
-
-	/* Locking avoids race with FREEZING -> THAWED transitions. */
-	if (freezer->state == CGROUP_FREEZING)
+	/*
+	 * @task might have been just migrated into a FROZEN cgroup.
Confused. If it was migrated, then freezer_attach() should take care
do freeze_task?

IOW,
Test
+	 * equality with THAWED.  Read the comment in freezer_attach().
+	 */
+	if (freezer->state != CGROUP_THAWED)
 		freeze_task(task);
-
This can only happen in the "normal" case, when a CGROUP_FREEZING task
forks the new child. So we could even do BUG_ON(state = CGROUP_FROZEN).

Or there could be another reason?

Oleg.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help