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

From: Paul Menage
Date: Fri Mar 28 2008 - 10:07:09 EST


On Fri, Mar 28, 2008 at 5:54 AM, Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/