[PATCH v2] ns: do not block exit_task_namespaces() for a long time

Al Viro viro at ZenIV.linux.org.uk
Mon Jul 16 16:53:01 UTC 2012


On Mon, Jul 16, 2012 at 06:09:24PM +0300, Kirill A. Shutemov wrote:
> From: "Kirill A. Shutemov" <kirill.shutemov at linux.intel.com>
> 
> On exiting of the last task in a namespace we need to trigger freeing of
> the namespace. Currently, we call synchronize_rcu() and free_nsproxy()
> directly on do_exit() path.
> 
> On my machine synchronize_rcu() blocks for about 0.01 seconds. For
> comparing: normal exit_group() syscall takes less than 0.0003 seconds.
> 
> Let's offload synchronize_rcu() and free_nsproxy() to a workqueue.
> 
> I also move synchronize_rcu() inside free_nsproxy(). It fixes racy
> put_nsproxy() which calls free_nsproxy() without synchronize_rcu().
> I guess it was missed during switch to RCU (see cf7b708).

NAK.  Making final umounts of anything in that namespace asynchronous,
even though nothing is holding the stuff on them busy is simply
wrong.  Note that they can take a _long_ time, so we are talking about
minutes worth of delay in the worst case.  It's user-visible and
it's a serious potential for trouble.


More information about the Containers mailing list