Messages in this thread | | | Date | Sat, 4 Feb 2006 15:50:19 -0800 | From | Andrew Morton <> | Subject | Re: [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/
| |