aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs/ufs/ufs_inode.c
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2012-04-20 07:00:28 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2012-04-20 07:00:28 +0000
commitdca5e0ec50115427fdc0c2ba9c44a3db8d29f9bd (patch)
tree10f55b579602c4e2bd1320448bee01fb50952a9d /sys/ufs/ufs/ufs_inode.c
parentf257ebbb2ed515290ac658ff5bac8e49f08bf96b (diff)
downloadsrc-dca5e0ec50115427fdc0c2ba9c44a3db8d29f9bd.tar.gz
src-dca5e0ec50115427fdc0c2ba9c44a3db8d29f9bd.zip
This update uses the MNT_VNODE_FOREACH_ACTIVE interface that loops
over just the active vnodes associated with a mount point to replace MNT_VNODE_FOREACH_ALL in the vfs_msync, ffs_sync_lazy, and qsync routines. The vfs_msync routine is run every 30 seconds for every writably mounted filesystem. It ensures that any files mmap'ed from the filesystem with modified pages have those pages queued to be written back to the file from which they are mapped. The ffs_lazy_sync and qsync routines are run every 30 seconds for every writably mounted UFS/FFS filesystem. The ffs_lazy_sync routine ensures that any files that have been accessed in the previous 30 seconds have had their access times queued for updating in the filesystem. The qsync routine ensures that any files with modified quotas have those quotas queued to be written back to their associated quota file. In a system configured with 250,000 vnodes, less than 1000 are typically active at any point in time. Prior to this change all 250,000 vnodes would be locked and inspected twice every minute by the syncer. For UFS/FFS filesystems they would be locked and inspected six times every minute (twice by each of these three routines since each of these routines does its own pass over the vnodes associated with a mount point). With this change the syncer now locks and inspects only the tiny set of vnodes that are active. Reviewed by: kib Tested by: Peter Holm MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=234483
Diffstat (limited to 'sys/ufs/ufs/ufs_inode.c')
-rw-r--r--sys/ufs/ufs/ufs_inode.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c
index 129c26d53a3b..3acc5c83a2a5 100644
--- a/sys/ufs/ufs/ufs_inode.c
+++ b/sys/ufs/ufs/ufs_inode.c
@@ -88,6 +88,14 @@ ufs_inactive(ap)
#ifdef UFS_GJOURNAL
ufs_gjournal_close(vp);
#endif
+#ifdef QUOTA
+ /*
+ * Before moving off the active list, we must be sure that
+ * any modified quotas have been pushed since these will no
+ * longer be checked once the vnode is on the inactive list.
+ */
+ qsyncvp(vp);
+#endif
if ((ip->i_effnlink == 0 && DOINGSOFTDEP(vp)) ||
(ip->i_nlink <= 0 && !UFS_RDONLY(ip))) {
loop: