Page MenuHomeFreeBSD

remove sync on umount -f
ClosedPublic

Authored by mjg on Sep 12 2018, 11:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 22 2024, 10:57 PM
Unknown Object (File)
Mar 22 2024, 10:56 PM
Unknown Object (File)
Mar 22 2024, 10:56 PM
Unknown Object (File)
Mar 8 2024, 4:05 AM
Unknown Object (File)
Jan 6 2024, 2:55 AM
Unknown Object (File)
Jan 6 2024, 2:55 AM
Unknown Object (File)
Jan 6 2024, 2:51 AM
Unknown Object (File)
Jan 4 2024, 6:14 AM
Subscribers

Details

Summary

umount -f performs sync which completely unnecessary triggers the syncer.

This happens to also cause performance problems when e.g. running synth (package building tool) which remounts filesystem for each package, unmounting with -f.

Both DragonflyBSD and NetBSD have plugged this years ago.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Can you show me the commit messages from ThatBSDs ?

This revision is now accepted and ready to land.Sep 13 2018, 12:36 PM
commit 136e843fb06cb9682ff05052bf187c08124ec4c2
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Sat Nov 6 08:41:02 2010 -0700

 umount - Remove sync() call from utility
 
 * Do not call sync() unconditionally when issuing the /sbin/umount command.
   Let the kernel take care of any syncing.
 
 * This may allow umount -f to operate better in situations where a mount
   might be stuck (such as a NFS mount), and also removes delays associated
   with scanning large numbers of vnodes on x86_64.

and

commit 8bb433caa1579a241e2c783ebc2f5549c6304531
Author: manu <manu@NetBSD.org>
Date:   Sat Jun 27 08:29:56 2015 +0000

  Remove useless and harmful sync(2) call in umount(8)
  
  Remove sync(2) call before unmount(2) in umount(8). This sync(2) is useless
  since unmount(2) will perform a VFS_SYNC anyway.
  
  But moreover, this sync(2) may be harmful, as there are some situation where
  it cannot return (unreachable NFS server, for instance), causing umount -f
  to be uneffective.
This revision was automatically updated to reflect the committed changes.