summaryrefslogtreecommitdiffstats
path: root/sys/rpc
diff options
context:
space:
mode:
authorrees <rees@FreeBSD.org>2004-03-25 21:48:09 +0000
committerrees <rees@FreeBSD.org>2004-03-25 21:48:09 +0000
commit4bf96c35a5e7311c05b04cba19ee0fabf9dd7e6d (patch)
tree0f26711985dd062f959b4e838a8d83a0dbd7e570 /sys/rpc
parent75ae6199e5dd7d621ed42390e425658541a06f48 (diff)
downloadFreeBSD-src-4bf96c35a5e7311c05b04cba19ee0fabf9dd7e6d.zip
FreeBSD-src-4bf96c35a5e7311c05b04cba19ee0fabf9dd7e6d.tar.gz
only do nfs rpc callouts if there is work to do.
Submitted by: kan Approved by: alfred
Diffstat (limited to 'sys/rpc')
-rw-r--r--sys/rpc/rpcclnt.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/rpc/rpcclnt.c b/sys/rpc/rpcclnt.c
index 9b0bb05..49ffea0 100644
--- a/sys/rpc/rpcclnt.c
+++ b/sys/rpc/rpcclnt.c
@@ -284,7 +284,6 @@ rpcclnt_init(void)
rpcclnt_timer(&rpcclnt_timer_to);
#else /* !__OpenBSD__ */
callout_init(&rpcclnt_callout, 0);
- rpcclnt_timer(NULL);
#endif /* !__OpenBSD__ */
RPCDEBUG("rpc initialed");
@@ -296,9 +295,8 @@ void
rpcclnt_uninit(void)
{
RPCDEBUG("uninit");
- callout_stop(&rpcclnt_callout);
-
/* XXX delete sysctl variables? */
+ callout_stop(&rpcclnt_callout);
}
int
@@ -1197,6 +1195,9 @@ rpcclnt_request(rpc, mrest, procnum, td, cred, reply)
* LAST so timer finds oldest requests first.
*/
s = splsoftclock();
+ if (TAILQ_EMPTY(&rpctask_q))
+ callout_reset(&rpcclnt_callout, rpcclnt_ticks, rpcclnt_timer,
+ NULL);
TAILQ_INSERT_TAIL(&rpctask_q, task, r_chain);
/*
@@ -1238,6 +1239,8 @@ rpcclnt_request(rpc, mrest, procnum, td, cred, reply)
*/
s = splsoftclock();
TAILQ_REMOVE(&rpctask_q, task, r_chain);
+ if (TAILQ_EMPTY(&rpctask_q))
+ callout_stop(&rpcclnt_callout);
splx(s);
/*
@@ -1475,8 +1478,6 @@ rpcclnt_timer(arg)
#ifdef __OpenBSD__
timeout_add(rpcclnt_timer, to, rpcclnt_ticks);
-#else
- callout_reset(&rpcclnt_callout, rpcclnt_ticks, rpcclnt_timer, NULL);
#endif
}
OpenPOWER on IntegriCloud