Re: Problems unmounting/fssyncking extern UFS filesystem



I realise the original posting was related to amd(8) and NFS is not a
normal filesystem but in the interest of trying to stamp out this myth...

On Mon, 2006-Nov-27 08:41:19 -0800, Kevin Oberman wrote:
The traditional mantra was
sync
sync
sync
...
That mantra is about 25 years old, so its validity on modern hardware is
questionable, but the need for a delay is very real.

For any modern Un*x, it is totally unnecessary. All current Un*x
filesystems will automatically flush all buffers as part of the
unmount process - specifically, any FS with a 'CLEAN' flag can
be guaranteed to do so.

I would suggest something like: sync && sleep 5

In the specific case of softupdates, this is not adequate to flush all
outstanding writes. The sync will flush one level of dependencies but
can still leave outstanding writes. 'sleep 5' may or may not be
adequate, depending on the amount of dirty cached data.

As an experiment, I suggest creating or deleting a FS tree on an
otherwise idle system and looking at the 'dirtybuf' value reported by
'systat -v 1'. See how many sync's and how long it takes to get it to
blank (0).

--
Peter Jeremy

Attachment: pgpUi9FrbpgT5.pgp
Description: PGP signature



Relevant Pages

  • Re: [PATCH -mm] swsusp: support creating bigger images (rev. 2)
    ... I believe more than a sync is needed in at least some cases. ... XFS will flush and wait on its journal on ... currently-incore-dirty-metadata ondisk, so it does not also flush ... particular background writing thread. ...
    (Linux-Kernel)
  • Re: Shutdown not working
    ... All I want is to kill all processes, flush all buffers, and turn off ... That will sync the file system and drop the system irrespective of whether processes are running. ... It will flush the filesystem caches, ... not applicatin buffers tho. ...
    (comp.os.linux.misc)
  • Re: [PATCH -mm] swsusp: support creating bigger images (rev. 2)
    ... I believe more than a sync is needed in at least some cases. ... doesn't mean flush all dirty metadata to its final resting place ... XFS will flush and wait on its journal on ... currently-incore-dirty-metadata ondisk, so it does not also flush ...
    (Linux-Kernel)
  • Re: Shutdown not working
    ... All I want is to kill all processes, flush all buffers, and turn off ... That will sync the file system and drop the system irrespective of ... halt will indeed properly flush all buffers ...
    (comp.os.linux.misc)
  • Re: consistent_sync_for_cpu() and friends on ppc32
    ... > have DMA caching or something like that, then sync for CPU can always be ... You will have always previously flushed the cpu caches before ... make MAP and sync for device writeback flush the cpu caches. ... No, flush on TO_DEVICE and BIDIRECTIONAL, invalidate on FROM_DEVICE, ...
    (Linux-Kernel)