[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 10 Oct 2011 10:11:05 -0700
From: Tejun Heo <htejun@...il.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: rjw@...k.pl, paul@...lmenage.org, lizf@...fujitsu.com,
linux-pm@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
containers@...ts.linux-foundation.org, fweisbec@...il.com,
matthltc@...ibm.com, akpm@...ux-foundation.org,
Paul Menage <menage@...gle.com>,
Ben Blum <bblum@...rew.cmu.edu>
Subject: Re: [PATCH 3/4] threadgroup: extend threadgroup_lock() to cover
exit and exec
Hello, Oleg.
Sorry about the very long delay. I moved cross atlantic and had a
pretty long vacation while doing it. Hope you can still remember some
of this one. :)
On Sun, Sep 18, 2011 at 07:37:23PM +0200, Oleg Nesterov wrote:
> > With this change, threadgroup_lock() guarantees that the target
> > threadgroup will remain stable - no new task will be added, no new
> > PF_EXITING will be set and exec won't happen.
>
> To me, this is the only "contradictory" change,
What do you mean "contradictory"? Can you please elaborate?
> > + /*
> > + * Release threadgroup and make sure we are holding no locks.
> > + */
> > + threadgroup_change_done(tsk);
>
> I am wondering, can't we narrow the scope of threadgroup_change_begin/done
> in do_exit() path?
>
> The code after 4/4 still has to check PF_EXITING, this is correct. And yes,
> with this patch PF_EXITING becomes stable under ->group_rwsem. But, it seems,
> we do not really need this?
>
> I mean, can't we change cgroup_exit() to do threadgroup_change_begin/done
> instead? We do not really care about PF_EXITING, we only need to ensure that
> we can't race with cgroup_exit(), right?
If we confine our usage to cgroup, excluding just against
cgroup_exit() might work although this is still a bit nasty. ie. some
callbacks might not expect half torn-down tasks in methods other than
the exit callback.
Also, it makes the mechanism unnecessarily cgroup-specific without
gaining much if anything. It's per-threadgroup rwsem so contention
isn't a problem and narrowing critical section isn't likely to be
beneficial (maybe slightly increase the chance of the cacheline for
the lock to be hot?).
Thank you.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists