lkml.org 
[lkml]   [2012]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC][PATCH] fix move/migrate_pages() race on task struct
    On 02/24/2012 09:32 AM, Christoph Lameter wrote:
    > @@ -1318,10 +1318,10 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pi
    > rcu_read_lock();
    > task = pid ? find_task_by_vpid(pid) : current;
    > if (!task) {
    > - rcu_read_unlock();
    > err = -ESRCH;
    > goto out;
    > }
    ...
    > + put_task_struct(task);
    > + task = NULL;
    > err = do_migrate_pages(mm, old, new,
    > capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE);
    > out:
    > + if (task)
    > + put_task_struct(task);
    > +
    > if (mm)
    > mmput(mm);
    > NODEMASK_SCRATCH_FREE(scratch);

    Man, patch did not like this for some reason. I kept throwing most of
    the mempolicy.c hunks away. I've never seen anything like it.

    Anyway... This looks fine except I think that rcu_read_unlock() need to
    stay. There's currently no release of it after out:.



    \
     
     \ /
      Last update: 2012-02-24 22:41    [W:4.085 / U:0.308 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site