From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Subject: [PATCH] vfs: Speed up deactivate_super for non-modular filesystems Date: Mon, 07 May 2012 14:51:08 -0700 Message-ID: <87r4uv64oj.fsf_-_@xmission.com> References: <1335604790.5995.22.camel@marge.simpson.net> <20120428142605.GA20248@redhat.com> <20120429165846.GA19054@redhat.com> <1335754867.17899.4.camel@marge.simpson.net> <20120501134214.f6b44f4a.akpm@linux-foundation.org> <1336014721.7370.32.camel@marge.simpson.net> <1336057018.8119.46.camel@marge.simpson.net> <1336105676.7356.42.camel@marge.simpson.net> <1336124716.25479.36.camel@marge.simpson.net> <1336142995.25479.49.camel@marge.simpson.net> <1336150643.7502.4.camel@marge.simpson.net> <1336197362.7346.9.camel@marge.simpson.net> <1336198093.7346.11.camel@marge.simpson.net> <1336201977.7346.22.camel@marge.simpson.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , Oleg Nesterov , LKML , Pavel Emelyanov , Cyrill Gorcunov , Louis Rilling , "Paul E. McKenney" , Mike Galbraith , Christoph Hellwig , To: Al Viro Return-path: Received: from out01.mta.xmission.com ([166.70.13.231]:53110 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752018Ab2EGVv1 (ORCPT ); Mon, 7 May 2012 17:51:27 -0400 In-Reply-To: <1336201977.7346.22.camel@marge.simpson.net> (Mike Galbraith's message of "Sat, 05 May 2012 09:12:57 +0200") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Recently it was observed that a distilled version of vsftp was taking a surprising amount of time reaping zombies. A measurement was taken and vsftp was taking about 4ms (one jiffie) to reap each zombie and those 4ms were spent spleeping in rcu_barrier in deactivate_locked_super. The reason vsftp was sleeping in deactivate_locked_super is because vsftp creates a pid namespace for each connection, and with that pid namespace comes an internal mount of /proc. That internal mount of proc is unmounted when the last process in the pid namespace is reaped. /proc and similar non-modular filesystems do not need a rcu_barrier in deactivate_locked_super. Being non-modular there is no danger of the rcu callback running after the module is unloaded. Therefore do the easy thing and remove 4ms+ from unmount times by only calling rcu_barrier for modular filesystems in unmount. Signed-off-by: Eric W. Biederman --- fs/super.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/super.c b/fs/super.c index cf00177..c739ef8 100644 --- a/fs/super.c +++ b/fs/super.c @@ -261,7 +261,8 @@ void deactivate_locked_super(struct super_block *s) * We need to call rcu_barrier so all the delayed rcu free * inodes are flushed before we release the fs module. */ - rcu_barrier(); + if (fs->owner) + rcu_barrier(); put_filesystem(fs); put_super(s); } else { -- 1.7.5.4