aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2005-05-30 18:02:00 +0000
committerAlan Cox <alc@FreeBSD.org>2005-05-30 18:02:00 +0000
commit8285135020bd0e98f45061cb7b0cc7ca9f097b8e (patch)
treee9bf2de1510e38912841f4f58a5654da214abe17
parent0717110a5aea5e057701fe6e404f08b6e58435d3 (diff)
downloadsrc-8285135020bd0e98f45061cb7b0cc7ca9f097b8e.tar.gz
src-8285135020bd0e98f45061cb7b0cc7ca9f097b8e.zip
Eliminate unnecessary calls to wakeup(); no one sleeps on &aio_freeproc.
Eliminate an unused flag, AIOP_SCHED; it's cleared but never set.
Notes
Notes: svn path=/head/; revision=146809
-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 8488664ea2cd..5e0d7fcff55b 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) &&