lkml.org 
[lkml]   [2011]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] threadgroup: extend threadgroup_lock() to cover exit and exec
On 10/12, Ben Blum wrote:
>
> On Wed, Oct 12, 2011 at 07:51:04PM +0200, Oleg Nesterov wrote:
> >
> > > Also, it makes the mechanism unnecessarily cgroup-specific without
> > > gaining much if anything.
> >
> > Yes! And _personally_ I think it should be cgroup-specific, that is
> > why I dislike the very fact do_exit() uses it directly. To me it would
> > be cleaner to shift it into cgroup hooks. Yes, sure, this is subjective.
>
> In the fork path, threadgroup_fork_read_...() is also called directly,
> not through cgroups. Would that change too?

Well, if you ask me, I'd prefer to move lock/unlock into
cgroup_fork/cgroup_post_fork ;) Although the error path plays with it
too. But this is minor.

> > In fact I still hope we can kill this sem altogether, but so far I have
> > no idea how we can do this. We do need the new per-process lock to
> > protect (in particular) ->thread_group. It is quite possible that it
> > should be rw_semaphore. But in this case we down_write(), not _read
> > in exit/fork paths, and its scope should be small.
>
> I'm confused - taking a big rwsem for writing in the fork/exit paths?

Yes, we need the new lock to avoid tasklist_lock.

> The point here is that even though fork/exit modify thread_group, they
> are logical "readers"

Yes I see. And this is one of the reasons why we can't use this lock
for above.

Oleg.



\
 
 \ /
  Last update: 2011-10-12 20:35    [W:0.066 / U:2.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site