aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2018-01-09 23:57:29 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2018-01-09 23:57:29 +0000
commit8091e52b42d66daf20e049bb9a7d6c46182deb76 (patch)
tree4e6bf74437b9ea09dce18e688ae3ba4ec961bb48 /sys/kern
parentdd5edb11b1baeb84dace48400c866ba234b22c16 (diff)
downloadsrc-8091e52b42d66daf20e049bb9a7d6c46182deb76.tar.gz
src-8091e52b42d66daf20e049bb9a7d6c46182deb76.zip
Add a counter to track in-flight AIO requests using unmapped I/O.
MFC after: 2 weeks Sponsored by: Chelsio Communications
Notes
Notes: svn path=/head/; revision=327752
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_aio.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index 817a0d71641f..c4bed4ce9541 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -150,6 +150,11 @@ static int num_buf_aio = 0;
SYSCTL_INT(_vfs_aio, OID_AUTO, num_buf_aio, CTLFLAG_RD, &num_buf_aio, 0,
"Number of aio requests presently handled by the buf subsystem");
+static int num_unmapped_aio = 0;
+SYSCTL_INT(_vfs_aio, OID_AUTO, num_unmapped_aio, CTLFLAG_RD, &num_unmapped_aio,
+ 0,
+ "Number of aio requests presently handled by unmapped I/O buffers");
+
/* Number of async I/O processes in the process of being started */
/* XXX This should be local to aio_aqueue() */
static int num_aio_resv_start = 0;
@@ -1305,6 +1310,7 @@ aio_qphysio(struct proc *p, struct kaiocb *job)
bp->bio_ma_offset = poff;
bp->bio_data = unmapped_buf;
bp->bio_flags |= BIO_UNMAPPED;
+ atomic_add_int(&num_unmapped_aio, 1);
}
/* Perform transfer. */
@@ -2365,7 +2371,8 @@ aio_physwakeup(struct bio *bp)
AIO_LOCK(ki);
ki->kaio_buffer_count--;
AIO_UNLOCK(ki);
- }
+ } else
+ atomic_subtract_int(&num_unmapped_aio, 1);
vm_page_unhold_pages(job->pages, job->npages);
bp = job->bp;