Re: [PATCH] cgroup_freezer: Freezing and task move race fix

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Matt Helsley
Date: Tuesday, August 10, 2010 - 9:27 pm

On Wed, Aug 11, 2010 at 12:18:44AM +0200, Tomasz Buchert wrote:

OK, I triggered it with that. Interesting.


I see what you mean. It still seems like it wouldn't actually fix the race -- just make it
harder to trigger. I think you're saying this is what happens without the patch:

Time	"bug" goes through these states		cgroup code checks for these states
-----------------------------------------------------------------------------------
|	freezing
|						is_frozen? Nope.
|	frozen
|						is_freezing? Nope.
|						<move>
V

But, without having carefully investigated the details, this could just as easily happen
with your patch:

Time	"bug" goes through these states		cgroup code checks for these states
-----------------------------------------------------------------------------------
|						is_freezing? Nope.
|						is_frozen? Nope.
|	freezing
|						<move>
|	frozen
V

or:

Time	"bug" goes through these states		cgroup code checks for these states
-----------------------------------------------------------------------------------
|						is_freezing? Nope.
|						is_frozen? Nope.
|	freezing
|	frozen
|						<move>
V

Time	"bug" goes through these states		cgroup code checks for these states
-----------------------------------------------------------------------------------
|						is_freezing? Nope.
|	freezing
|						is_frozen? Nope.
|						<move>
|	frozen
V

or:

Time	"bug" goes through these states		cgroup code checks for these states
-----------------------------------------------------------------------------------
|						is_freezing? Nope.
|	freezing
|						is_frozen? Nope.
|	frozen
|						<move>
V

(even with 1 cpu/core)

Your patch only improves things in the sense that it works for the first
example. We need to prevent the latter cases as well.

Cheers,
	-Matt
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] cgroup_freezer: Freezing and task move race fix, Tomasz Buchert, (Tue Aug 10, 12:53 pm)
Re: [PATCH] cgroup_freezer: Freezing and task move race fix, Matt Helsley, (Tue Aug 10, 9:27 pm)
Re: [PATCH] cgroup_freezer: Freezing and task move race fix, Tomasz Buchert, (Wed Aug 11, 12:30 am)
Re: [PATCH] cgroup_freezer: Freezing and task move race fix, Tomasz Buchert, (Wed Aug 11, 12:35 am)
[PATCH 0/3] Two bugfixes for cgroup freezer. , Tomasz Buchert, (Thu Aug 12, 2:45 am)
Re: [PATCH] cgroup_freezer: Freezing and task move race fix, Rafael J. Wysocki, (Thu Aug 12, 6:35 pm)