1 From: Olaf Kirch <okir@suse.de>
2 Subject: Do not call shrink_dcache_sb when remounting procfs etc
5 Avoid calls to shrink_dcache_sb when mounting a file system that
6 uses get_sb_single. shrink_dcache_sb is costly. On large ia64
7 systems, this will keep the dcache lock for > 60 seconds at
10 Signed-off-by: Olaf Kirch <okir@suse.de>
12 fs/super.c | 36 +++++++++++++++++++++++-------------
13 1 file changed, 23 insertions(+), 13 deletions(-)
17 @@ -597,16 +597,10 @@ retry:
22 - * do_remount_sb - asks filesystem to change mount options.
23 - * @sb: superblock in question
24 - * @flags: numeric part of options
25 - * @data: the rest of options
26 - * @force: whether or not to force the change
28 - * Alters the mount options of a mounted file system.
30 -int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
31 +#define REMOUNT_FORCE 1
32 +#define REMOUNT_SHRINK_DCACHE 2
34 +static int __do_remount_sb(struct super_block *sb, int flags, void *data, int rflags)
38 @@ -617,13 +611,14 @@ int do_remount_sb(struct super_block *sb
40 if (flags & MS_RDONLY)
42 - shrink_dcache_sb(sb);
43 + if (rflags & REMOUNT_SHRINK_DCACHE)
44 + shrink_dcache_sb(sb);
47 /* If we are remounting RDONLY and current sb is read/write,
48 make sure there are no rw files opened */
49 if ((flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY)) {
51 + if (rflags & REMOUNT_FORCE)
53 else if (!fs_may_remount_ro(sb))
55 @@ -646,6 +641,21 @@ int do_remount_sb(struct super_block *sb
60 + * do_remount_sb - asks filesystem to change mount options.
61 + * @sb: superblock in question
62 + * @flags: numeric part of options
63 + * @data: the rest of options
64 + * @force: whether or not to force the change
66 + * Alters the mount options of a mounted file system.
68 +int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
70 + return __do_remount_sb(sb, flags, data,
71 + REMOUNT_SHRINK_DCACHE|(force? REMOUNT_FORCE : 0));
74 static void do_emergency_remount(unsigned long foo)
76 struct super_block *sb;
77 @@ -877,7 +887,7 @@ int get_sb_single(struct file_system_typ
79 s->s_flags |= MS_ACTIVE;
81 - do_remount_sb(s, flags, data, 0);
82 + __do_remount_sb(s, flags, data, 0);
83 return simple_set_mnt(mnt, s);