lkml.org 
[lkml]   [2012]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2012-03-08 19:29    [W:0.081 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site