summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_aio.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2005-05-30 18:02:00 +0000
committeralc <alc@FreeBSD.org>2005-05-30 18:02:00 +0000
commit3ecc8d11296780a18459f5270b2b22cfa17295b8 (patch)
treee9bf2de1510e38912841f4f58a5654da214abe17 /sys/kern/vfs_aio.c
parent7f33e6190e5c2a0bc9de70efe0325f06c6decd7d (diff)
downloadFreeBSD-src-3ecc8d11296780a18459f5270b2b22cfa17295b8.zip
FreeBSD-src-3ecc8d11296780a18459f5270b2b22cfa17295b8.tar.gz
Eliminate unnecessary calls to wakeup(); no one sleeps on &aio_freeproc.
Eliminate an unused flag, AIOP_SCHED; it's cleared but never set.
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r--sys/kern/vfs_aio.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index 8488664..5e0d7fc 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -196,7 +196,6 @@ struct aiocblist {
* AIO process info
*/
#define AIOP_FREE 0x1 /* proc on free queue */
-#define AIOP_SCHED 0x2 /* proc explicitly scheduled */
struct aiothreadlist {
int aiothreadflags; /* AIO proc flags */
@@ -797,8 +796,6 @@ aio_daemon(void *uproc)
/*
* Place thread (lightweight process) onto the AIO free thread list.
*/
- if (TAILQ_EMPTY(&aio_freeproc))
- wakeup(&aio_freeproc);
TAILQ_INSERT_HEAD(&aio_freeproc, aiop, list);
splx(s);
@@ -843,7 +840,6 @@ aio_daemon(void *uproc)
aiop->aiothreadflags &= ~AIOP_FREE;
splx(s);
}
- aiop->aiothreadflags &= ~AIOP_SCHED;
/*
* Check for jobs.
@@ -972,13 +968,7 @@ aio_daemon(void *uproc)
curcp = mycp;
}
- /*
- * If we are the first to be put onto the free queue, wakeup
- * anyone waiting for a daemon.
- */
s = splnet();
- if (TAILQ_EMPTY(&aio_freeproc))
- wakeup(&aio_freeproc);
TAILQ_INSERT_HEAD(&aio_freeproc, aiop, list);
aiop->aiothreadflags |= AIOP_FREE;
splx(s);
@@ -987,8 +977,7 @@ aio_daemon(void *uproc)
* If daemon is inactive for a long time, allow it to exit,
* thereby freeing resources.
*/
- if ((aiop->aiothreadflags & AIOP_SCHED) == 0 &&
- tsleep(aiop->aiothread, PRIBIO, "aiordy", aiod_lifetime)) {
+ if (tsleep(aiop->aiothread, PRIBIO, "aiordy", aiod_lifetime)) {
s = splnet();
if (TAILQ_EMPTY(&aio_jobs)) {
if ((aiop->aiothreadflags & AIOP_FREE) &&
OpenPOWER on IntegriCloud