summaryrefslogtreecommitdiffstats
path: root/usr.bin/vi
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2012-02-07 20:43:28 +0000
committermckusick <mckusick@FreeBSD.org>2012-02-07 20:43:28 +0000
commit3619d603a7c9a5ce6abe764366b472e421a5da40 (patch)
treebc91bb302c502bbccb492f8d484b961f67b0b921 /usr.bin/vi
parente04eff2488f2e61bf16e804dbb4cdcf635ef86dc (diff)
downloadFreeBSD-src-3619d603a7c9a5ce6abe764366b472e421a5da40.zip
FreeBSD-src-3619d603a7c9a5ce6abe764366b472e421a5da40.tar.gz
In the original days of BSD, a sync was issued on every filesystem
every 30 seconds. This spike in I/O caused the system to pause every 30 seconds which was quite annoying. So, the way that sync worked was changed so that when a vnode was first dirtied, it was put on a 30-second cleaning queue (see the syncer_workitem_pending queues in kern/vfs_subr.c). If the file has not been written or deleted after 30 seconds, the syncer pushes it out. As the syncer runs once per second, dirty files are trickled out slowly over the 30-second period instead of all at once by a call to sync(2). The one drawback to this is that it does not cover the filesystem metadata. To handle the metadata, vfs_allocate_syncvnode() is called to create a "filesystem syncer vnode" at mount time which cycles around the cleaning queue being sync'ed every 30 seconds. In the original design, the only things it would sync for UFS were the filesystem metadata: inode blocks, cylinder group bitmaps, and the superblock (e.g., by VOP_FSYNC'ing devvp, the device vnode from which the filesystem is mounted). Somewhere in its path to integration with FreeBSD the flushing of the filesystem syncer vnode got changed to sync every vnode associated with the filesystem. The result of this change is to return to the old filesystem-wide flush every 30-seconds behavior and makes the whole 30-second delay per vnode useless. This change goes back to the originally intended trickle out sync behavior. Key to ensuring that all the intended semantics are preserved (e.g., that all inode updates get flushed within a bounded period of time) is that all inode modifications get pushed to their corresponding inode blocks so that the metadata flush by the filesystem syncer vnode gets them to the disk in a timely way. Thanks to Konstantin Belousov (kib@) for doing the audit and commit -r231122 which ensures that all of these updates are being made. Reviewed by: kib Tested by: scottl MFC after: 2 weeks
Diffstat (limited to 'usr.bin/vi')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud