linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] VFS: use synchronize_rcu_expedited() in namespace_unlock()
@ 2017-10-26  2:26 NeilBrown
  2017-10-26 12:27 ` Paul E. McKenney
  0 siblings, 1 reply; 16+ messages in thread
From: NeilBrown @ 2017-10-26  2:26 UTC (permalink / raw)
  To: Alexander Viro
  Cc: linux-fsdevel, linux-kernel, Paul E. McKenney, Josh Triplett

[-- Attachment #1: Type: text/plain, Size: 1421 bytes --]


The synchronize_rcu() in namespace_unlock() is called every time
a filesystem is unmounted.  If a great many filesystems are mounted,
this can cause a noticable slow-down in, for example, system shutdown.

The sequence:
  mkdir -p /tmp/Mtest/{0..5000}
  time for i in /tmp/Mtest/*; do mount -t tmpfs tmpfs $i ; done
  time umount /tmp/Mtest/*

on a 4-cpu VM can report 8 seconds to mount the tmpfs filesystems, and
100 seconds to unmount them.

Boot the same VM with 1 CPU and it takes 18 seconds to mount the
tmpfs filesystems, but only 36 to unmount.

If we change the synchronize_rcu() to synchronize_rcu_expedited()
the umount time on a 4-cpu VM is 8 seconds to mount and 0.6 to
unmount.

I think this 200-fold speed up is worth the slightly higher system
impact of use synchronize_rcu_expedited().

Signed-off-by: NeilBrown <neilb@suse.com>
---

Cc: to Paul and Josh in case they'll correct me if using _expedited()
is really bad here.

Thanks,
NeilBrown


 fs/namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 3b601f115b6c..fce91c447fab 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1420,7 +1420,7 @@ static void namespace_unlock(void)
 	if (likely(hlist_empty(&head)))
 		return;
 
-	synchronize_rcu();
+	synchronize_rcu_expedited();
 
 	group_pin_kill(&head);
 }
-- 
2.14.0.rc0.dirty


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-11-30  1:09 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-26  2:26 [PATCH] VFS: use synchronize_rcu_expedited() in namespace_unlock() NeilBrown
2017-10-26 12:27 ` Paul E. McKenney
2017-10-26 13:50   ` Paul E. McKenney
2017-10-27  0:45   ` NeilBrown
2017-10-27  1:24     ` Paul E. McKenney
2017-11-27 11:27   ` Florian Weimer
2017-11-27 14:41     ` Paul E. McKenney
2017-11-28 22:17       ` NeilBrown
2018-10-05  1:27         ` [PATCH - resend] " NeilBrown
2018-10-05  1:40           ` Al Viro
2018-10-05  2:53             ` NeilBrown
2018-10-05  4:08             ` Paul E. McKenney
2018-11-29 23:33             ` [PATCH - resend*2] " NeilBrown
2018-11-29 23:52               ` Al Viro
2018-11-30  1:09                 ` NeilBrown
2018-11-06  3:15           ` [PATCH - resend] " NeilBrown

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).