lkml.org 
[lkml]   [2006]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] cpuset memory spread slab cache optimizations
Paul Jackson <pj@sgi.com> wrote:
>
> +void mpol_set_task_struct_flag(struct task_struct *p)
> +{
> + if (p->mempolicy)
> + p->flags |= PF_MEMPOLICY;
> + else
> + p->flags &= ~PF_MEMPOLICY;
> +}

As mentioned before, if we ever modify tsk->flags, where tsk != current, we
have a nasty race. So this function's interface really does invite that
race and hence is not very good.

As we do seem to be only calling it for current or for a newly-created task
I guess the access is OK, so perhaps a weaselly comment would cover that
worry.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-05 00:54    [W:0.145 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site