diff options
author | dillon <dillon@FreeBSD.org> | 2002-12-28 21:03:42 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2002-12-28 21:03:42 +0000 |
commit | 1f367998c639b9b2dee080f7467459ca1022d8f6 (patch) | |
tree | 6cffc6f9ccdc1c4a44a43daf79d118bd9b6cede7 /sys/vm/vnode_pager.c | |
parent | fd92c8a19592993604b8a8f8e42a06219e8dd545 (diff) | |
download | FreeBSD-src-1f367998c639b9b2dee080f7467459ca1022d8f6.zip FreeBSD-src-1f367998c639b9b2dee080f7467459ca1022d8f6.tar.gz |
Allow the VM object flushing code to cluster. When the filesystem syncer
comes along and flushes a file which has been mmap()'d SHARED/RW, with
dirty pages, it was flushing the underlying VM object asynchronously,
resulting in thousands of 8K writes. With this change the VM Object flushing
code will cluster dirty pages in 64K blocks.
Note that until the low memory deadlock issue is reviewed, it is not safe
to allow the pageout daemon to use this feature. Forced pageouts still
use fs block size'd ops for the moment.
MFC after: 3 days
Diffstat (limited to 'sys/vm/vnode_pager.c')
-rw-r--r-- | sys/vm/vnode_pager.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index cf98090..667bd3a 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -1044,11 +1044,17 @@ vnode_pager_generic_putpages(vp, m, bytecount, flags, rtvals) /* * pageouts are already clustered, use IO_ASYNC t o force a bawrite() * rather then a bdwrite() to prevent paging I/O from saturating - * the buffer cache. + * the buffer cache. Dummy-up the sequential heuristic to cause + * large ranges to cluster. If neither IO_SYNC or IO_ASYNC is set, + * the system decides how to cluster. */ ioflags = IO_VMIO; - ioflags |= (flags & (VM_PAGER_PUT_SYNC | VM_PAGER_PUT_INVAL)) ? IO_SYNC: IO_ASYNC; + if (flags & (VM_PAGER_PUT_SYNC | VM_PAGER_PUT_INVAL)) + ioflags |= IO_SYNC; + else if ((flags & VM_PAGER_CLUSTER_OK) == 0) + ioflags |= IO_ASYNC; ioflags |= (flags & VM_PAGER_PUT_INVAL) ? IO_INVAL: 0; + ioflags |= IO_SEQMAX << IO_SEQSHIFT; aiov.iov_base = (caddr_t) 0; aiov.iov_len = maxsize; |