Messages in this thread | | | Date | Thu, 8 Mar 2012 10:26:22 -0800 | From | Tejun Heo <> | Subject | Re: [RFC][PATCH] cgroup: fix race between fork and cgroup freezing |
| |
Hello, Li, Frederic.
On Thu, Mar 08, 2012 at 04:45:13PM +0800, Li Zefan wrote: > +static void freezer_post_fork(struct cgroup_subsys *ss, > + struct task_struct *task) > +{ > + struct freezer *freezer; > + > + cgroup_lock(); > + > + freezer = task_freezer(task); > + if (!freezer->css.cgroup->parent) > + goto out; > + > + spin_lock_irq(&freezer->lock); > + if (freezer->state != CGROUP_THAWED) > + freeze_task(task); > + spin_unlock_irq(&freezer->lock); > +out: > + cgroup_unlock(); > +}
Urgh... this is requiring policy implementations to synchronize with problem caused by cgroup core optimization and it's so very subtle. IMHO, this definitely should be contained in cgroup core and in a very confined form even inside cgroup core.
Any other ideas?
Thanks.
-- tejun
| |