[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87r4uv64oj.fsf_-_@xmission.com>
Date: Mon, 07 May 2012 14:51:08 -0700
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Al Viro <viro@...IV.linux.org.uk>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Oleg Nesterov <oleg@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
Pavel Emelyanov <xemul@...allels.com>,
Cyrill Gorcunov <gorcunov@...nvz.org>,
Louis Rilling <louis.rilling@...labs.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Mike Galbraith <efault@....de>,
Christoph Hellwig <hch@...radead.org>,
<linux-fsdevel@...r.kernel.org>
Subject: [PATCH] vfs: Speed up deactivate_super for non-modular filesystems
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@...ssion.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
--
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