summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1997-10-11 01:07:03 +0000
committerdyson <dyson@FreeBSD.org>1997-10-11 01:07:03 +0000
commita00683f93c01e2cd55e8525d082384374b6dbdcc (patch)
tree99f36b4aa193b573c683d545a1caa00efe911411 /sys
parent0fffdd6061a0a089b2a0114f5a6a3e1e2799ce3b (diff)
downloadFreeBSD-src-a00683f93c01e2cd55e8525d082384374b6dbdcc.zip
FreeBSD-src-a00683f93c01e2cd55e8525d082384374b6dbdcc.tar.gz
Make the target for the number of AIO daemons work.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_aio.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index 7ae19d7..8b4ee74 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -13,7 +13,7 @@
* bad that happens because of using this software isn't the responsibility
* of the author. This software is distributed AS-IS.
*
- * $Id: vfs_aio.c,v 1.4 1997/09/02 20:06:00 bde Exp $
+ * $Id: vfs_aio.c,v 1.5 1997/10/09 04:14:41 dyson Exp $
*/
/*
@@ -474,7 +474,12 @@ aio_startproc(void *uproc)
TAILQ_INSERT_HEAD(&aio_freeproc, aiop, list);
aiop->aioprocflags |= AIOP_FREE;
}
- tsleep(cp, PRIBIO, "aiordy", 0);
+ if (tsleep(cp, PRIBIO, "aiordy", hz*30)) {
+ if ((num_aio_procs > target_aio_procs) &&
+ (TAILQ_FIRST(&aiop->jobtorun) == NULL))
+ exit1(curproc, 0);
+ }
+
if (aiop->aioprocflags & AIOP_FREE) {
TAILQ_REMOVE(&aio_freeproc, aiop, list);
TAILQ_INSERT_TAIL(&aio_activeproc, aiop, list);
@@ -658,6 +663,17 @@ _aio_aqueue(struct proc *p, struct aiocb *job, int type) {
return EBADF;
}
+#if DEBUGAIO > 0
+ if (debugaio > 3)
+ printf("aio_aqueue: fd: %d, cmd: %d, buf: %d, cnt: %d, fileoffset: %d\n",
+ aiocbe->uaiocb.aio_fildes,
+ aiocbe->uaiocb.aio_lio_opcode,
+ (int) aiocbe->uaiocb.aio_buf & 0xffffffff,
+ aiocbe->uaiocb.aio_nbytes,
+ (int) aiocbe->uaiocb.aio_offset & 0xffffffff);
+#endif
+
+
fp = fdp->fd_ofiles[fd];
if ((fp == NULL) ||
((opcode == LIO_WRITE) && ((fp->f_flag & FWRITE) == 0))) {
OpenPOWER on IntegriCloud