Comment 0 for bug 585092

Revision history for this message
Brian Bloniarz (brianbloniarz) wrote : tmpfs umount slowdown

On a fresh lucid install, an unmount of an empty tmpfs mount is quite slow:

# mkdir -p /tmp/test; mount -t tmpfs nodev /tmp/test; time umount /tmp/test
real 0m0.318s
user 0m0.000s
sys 0m0.020s

If there is pending I/O on any other filesystem, it can be even slower:
# dd if=/dev/zero of=/tmp/testfile bs=1024 count=1024
# mkdir -p /tmp/test; mount -t tmpfs nodev /tmp/test; time umount /tmp/test
real 0m8.270s
user 0m0.000s
sys 0m0.010s

This is a regression from previous versions, e.g. on hardy:
# uname -r
2.6.24-19-generic
# mkdir -p /tmp/test; mount -t tmpfs nodev /tmp/test; time umount /tmp/test
real 0m0.001s
user 0m0.000s
sys 0m0.000s

The root cause is the workaround patch which fixed bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/543617. It syncs all filesystems when umount is called, not just the involved filesystem, and applies to unmount of non-ext4 FSs. I've verified that the problem goes away with that patch reverted.