aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2020-08-16 21:02:45 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-08-16 21:02:45 +0000
commitfbca789fc328487a1be438f5235e4c0ad0eb849b (patch)
treee3ef97c76f97aa02509828b92b74d76c67945e68 /sys/kern/vfs_subr.c
parentffae7ea93529250758d77eb899bd9b42faeb980f (diff)
downloadsrc-fbca789fc328487a1be438f5235e4c0ad0eb849b.tar.gz
src-fbca789fc328487a1be438f5235e4c0ad0eb849b.zip
VMIO read
If possible, i.e. if the requested range is resident valid in the vm object queue, and some secondary conditions hold, copy data for read(2) directly from the valid cached pages, avoiding vnode lock and instantiating buffers. I intentionally do not start read-ahead, nor handle the advises on the cached range. Filesystems indicate support for VMIO reads by setting VIRF_PGREAD flag, which must not be cleared until vnode reclamation. Currently only filesystems that use vnode pager for v_objects can enable it, due to reliance on vnp_size. There is a WIP to handle it for tmpfs. Reviewed by: markj Discussed with: jeff Tested by: pho Benchmarked by: mjg Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25968
Notes
Notes: svn path=/head/; revision=364287
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 9980de4d0fdd..2df609d9118b 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -3959,7 +3959,9 @@ vn_printf(struct vnode *vp, const char *fmt, ...)
buf[1] = '\0';
if (vp->v_irflag & VIRF_DOOMED)
strlcat(buf, "|VIRF_DOOMED", sizeof(buf));
- flags = vp->v_irflag & ~(VIRF_DOOMED);
+ if (vp->v_irflag & VIRF_PGREAD)
+ strlcat(buf, "|VIRF_PGREAD", sizeof(buf));
+ flags = vp->v_irflag & ~(VIRF_DOOMED | VIRF_PGREAD);
if (flags != 0) {
snprintf(buf2, sizeof(buf2), "|VIRF(0x%lx)", flags);
strlcat(buf, buf2, sizeof(buf));