From: ebiederm@xmission.com (Eric W. Biederman)
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Oleg Nesterov <oleg@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
Pavel Emelyanov <xemul@parallels.com>,
Cyrill Gorcunov <gorcunov@openvz.org>,
Louis Rilling <louis.rilling@kerlabs.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Mike Galbraith <efault@gmx.de>,
Christoph Hellwig <hch@infradead.org>,
<linux-fsdevel@vger.kernel.org>
Subject: [PATCH] vfs: Speed up deactivate_super for non-modular filesystems
Date: Mon, 07 May 2012 14:51:08 -0700 [thread overview]
Message-ID: <87r4uv64oj.fsf_-_@xmission.com> (raw)
In-Reply-To: <1336201977.7346.22.camel@marge.simpson.net> (Mike Galbraith's message of "Sat, 05 May 2012 09:12:57 +0200")
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 <ebiederm@xmission.com>
---
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
next parent reply other threads:[~2012-05-07 21:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1335604790.5995.22.camel@marge.simpson.net>
[not found] ` <20120428142605.GA20248@redhat.com>
[not found] ` <m14ns355ru.fsf@fess.ebiederm.org>
[not found] ` <20120429165846.GA19054@redhat.com>
[not found] ` <1335754867.17899.4.camel@marge.simpson.net>
[not found] ` <m1zk9rmyh4.fsf@fess.ebiederm.org>
[not found] ` <20120501134214.f6b44f4a.akpm@linux-foundation.org>
[not found] ` <1336014721.7370.32.camel@marge.simpson.net>
[not found] ` <1336057018.8119.46.camel@marge.simpson.net>
[not found] ` <1336105676.7356.42.camel@marge.simpson.net>
[not found] ` <m1aa1oidmn.fsf@fess.ebiederm.org>
[not found] ` <1336124716.25479.36.camel@marge.simpson.net>
[not found] ` <m1vckcdoey.fsf@fess.ebiederm.org>
[not found] ` <1336142995.25479.49.camel@marge.simpson.net>
[not found] ` <m1zk9oc61j.fsf@fess.ebiederm.org>
[not found] ` <1336150643.7502.4.camel@marge.simpson.net>
[not found] ` <m1fwbfd71h.fsf@fess.ebiederm.org>
[not found] ` <1336197362.7346.9.camel@marge.simpson.net>
[not found] ` <1336198093.7346.11.camel@marge.simpson.net>
[not found] ` <1336201977.7346.22.camel@marge.simpson.net>
2012-05-07 21:51 ` Eric W. Biederman [this message]
2012-05-07 22:17 ` [PATCH] vfs: Speed up deactivate_super for non-modular filesystems Al Viro
2012-05-07 23:56 ` Paul E. McKenney
2012-05-08 1:07 ` Eric W. Biederman
2012-05-08 4:53 ` Mike Galbraith
2012-05-09 7:55 ` Nick Piggin
2012-05-09 11:02 ` Eric W. Biederman
2012-05-15 8:40 ` Nick Piggin
2012-05-16 0:34 ` Eric W. Biederman
2012-05-09 13:59 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r4uv64oj.fsf_-_@xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=efault@gmx.de \
--cc=gorcunov@openvz.org \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=louis.rilling@kerlabs.com \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=viro@ZenIV.linux.org.uk \
--cc=xemul@parallels.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).