aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorThomas Munro <tmunro@FreeBSD.org>2020-06-21 08:51:24 +0000
committerThomas Munro <tmunro@FreeBSD.org>2020-06-21 08:51:24 +0000
commitf2706588730a5d3b9a687ba8d4269e386650cc4f (patch)
tree6af7a3efa2502ab3e819c7aa522f1fd908696bab /sys/fs
parent03270b59eed68cc33478a731a12269870e5168d2 (diff)
downloadsrc-f2706588730a5d3b9a687ba8d4269e386650cc4f.tar.gz
src-f2706588730a5d3b9a687ba8d4269e386650cc4f.zip
vfs: track sequential reads and writes separately
For software like PostgreSQL and SQLite that sometimes reads sequentially while also writing sequentially some distance behind with interleaved syscalls on the same fd, performance is better on UFS if we do sequential access heuristics separately for reads and writes. Patch originally by Andrew Gierth in 2008, updated and proposed by me with his permission. Reviewed by: mjg, kib, tmunro Approved by: mjg (mentor) Obtained from: Andrew Gierth <andrew@tao11.riddles.org.uk> Differential Revision: https://reviews.freebsd.org/D25024
Notes
Notes: svn path=/head/; revision=362460
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/devfs/devfs_vnops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index f038f74e67a0..e7e524d2f0b9 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -1305,7 +1305,7 @@ devfs_read_f(struct file *fp, struct uio *uio, struct ucred *cred,
td->td_fpop = fpop;
dev_relthread(dev, ref);
- foffset_unlock_uio(fp, uio, flags | FOF_NOLOCK | FOF_NEXTOFF);
+ foffset_unlock_uio(fp, uio, flags | FOF_NOLOCK | FOF_NEXTOFF_R);
return (error);
}
@@ -1802,7 +1802,7 @@ devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred,
td->td_fpop = fpop;
dev_relthread(dev, ref);
- foffset_unlock_uio(fp, uio, flags | FOF_NOLOCK | FOF_NEXTOFF);
+ foffset_unlock_uio(fp, uio, flags | FOF_NOLOCK | FOF_NEXTOFF_W);
return (error);
}