Re: [-mm] Add an owner to the mm_struct (v2)

Paul Menage
2008-03-28T14:06:54Z

On Fri, Mar 28, 2008 at 5:54 AM, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
>
> Thinking more, I don't think it makes sense for us to overload task_lock() to do
> the mm->owner handling (we don't want to mix lock domains). task_lock() is used
> for several things
>
> 1. We don't want to make task_lock() rules more complicated by having it protect
> an mm member to save space
> 2. We don't want more contention on task_lock()
>

This isn't to save space, it's to provide correctness. We *have* to
hold task_lock(new_owner) before setting mm->owner = new_owner,
otherwise we have no guarantee that new_owner is still a user of mm.

Paul