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

From: Balbir Singh
Date: Wed Apr 16 2008 - 23:41:38 EST


Oleg Nesterov wrote:
> On 04/15, Paul Menage wrote:
>> On Tue, Apr 15, 2008 at 10:13 AM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>>> Let's suppose the process with a lot of threads does exit_group() and nobody
>>> else uses this ->mm. How many time we will re-assign mm->owner and iterate
>>> over the all threads in system ?
>>>
>> In general we won't get to the third loop, since one of the first two
>> loops (children or siblings) will find another mm user.
>
> Well yes, the second loop checks parent->children ... all sub-threads have
> the same parent.
>
> I'd suggest to use ->real_parent though. And the third loop could be
>

real_parent is for ptraced processes right?

> for_each_process(g) {
> c = g;
> do {
> if (!c->mm)
> continue;
> if (c->mm != mm)
> break;
> goto assign_new_owner;
> } while_each_thread(g, c);
> }
>

I had this loop earlier (inspired from zap_threads()), is this loop more
efficient than what we have?

> Still. can't we make mm->mm_users_list ?
>

I suspect that will be expensive to maintain. Specially with large number of
threads. I see a large space overhead and time overhead and additional
synchronization overhead. Apart from finding the next owner is there any other
advantage?

> Oleg.
>


--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
--
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/