[lkml]   [2008]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] cgroup: fix a race condition in manipulating tsk->cg_list
    On Wed, Apr 16, 2008 at 9:11 PM, Andrew Morton
    <> wrote:
    > I don't fully understand the race. Both paths hold css_set_lock.
    > Can you describe it in more detail please?

    Task A starts exiting, passes the check for unlinking current->cg_list.

    Before it completely exits task B does the very first
    cgroup_iter_begin() call (via reading a cgroups tasks file) which
    links all tasks in to their css_set objects via tsk->cg_list.

    Then task A finishes exiting and is freed, but doesn't unlink from the cg_list.

    > afacit the task at *p could set PF_EXITING immediately after this code has
    > tested PF_EXITING and then the task at *p could proceed until we hit the
    > same race (whatever that is).

    The important fact there is that the task sets PF_EXITING *before* it
    checks whether it needs to unlink from current->cg_list.


     \ /
      Last update: 2008-04-17 06:21    [W:0.020 / U:3.848 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site