From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kirill A. Shutemov" Subject: Re: [PATCH v2] ns: do not block exit_task_namespaces() for a long time Date: Mon, 16 Jul 2012 20:16:34 +0300 Message-ID: <20120716171634.GA21620@shutemov.name> References: <20120713140806.b3d0fda8.akpm@linux-foundation.org> <1342451364-14787-1-git-send-email-kirill.shutemov@linux.intel.com> <20120716165301.GN31729@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20120716165301.GN31729-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Al Viro Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "Dmitry V. Levin" , Doug Ledford , KOSAKI Motohiro , Andrew Morton , "Kirill A. Shutemov" , Pavel Emelyanov List-Id: containers.vger.kernel.org On Mon, Jul 16, 2012 at 05:53:01PM +0100, Al Viro wrote: > On Mon, Jul 16, 2012 at 06:09:24PM +0300, Kirill A. Shutemov wrote: > > From: "Kirill A. Shutemov" > > > > 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. Good point. Now in worst case we have a process which hang for a few minutes in exit_group() syscall in D state, right? Why is that any better? Does it provide better user experience or better accounting or what? -- Kirill A. Shutemov