summaryrefslogtreecommitdiffstats
path: root/sys/netpfil
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2013-08-24 13:34:36 +0000
committermav <mav@FreeBSD.org>2013-08-24 13:34:36 +0000
commit413bf347cd8d75b5cc702edaa5b26ae8b14c9f6b (patch)
treef402d81e3fb54380b80e4c1a1d1d5bfe58f4f519 /sys/netpfil
parent817be10f1c2c92e0673cb372ae147817a30f922b (diff)
downloadFreeBSD-src-413bf347cd8d75b5cc702edaa5b26ae8b14c9f6b.zip
FreeBSD-src-413bf347cd8d75b5cc702edaa5b26ae8b14c9f6b.tar.gz
Make dummynet use new direct callout(9) execution mechanism. Since the only
thing done by the dummynet handler is taskqueue_enqueue() call, it doesn't need extra switch to the clock SWI context. On idle system this change in half reduces number of active CPU cycles and wakes up only one CPU from sleep instead of two. I was going to make this change much earlier as part of calloutng project, but waited for better solution with skipping idle ticks to be implemented. Unfortunately with 10.0 release coming it is better get at least this.
Diffstat (limited to 'sys/netpfil')
-rw-r--r--sys/netpfil/ipfw/ip_dummynet.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/netpfil/ipfw/ip_dummynet.c b/sys/netpfil/ipfw/ip_dummynet.c
index 429f2f1..4de2156 100644
--- a/sys/netpfil/ipfw/ip_dummynet.c
+++ b/sys/netpfil/ipfw/ip_dummynet.c
@@ -82,13 +82,15 @@ dummynet(void *arg)
{
(void)arg; /* UNUSED */
- taskqueue_enqueue(dn_tq, &dn_task);
+ taskqueue_enqueue_fast(dn_tq, &dn_task);
}
void
dn_reschedule(void)
{
- callout_reset(&dn_timeout, 1, dummynet, NULL);
+
+ callout_reset_sbt(&dn_timeout, tick_sbt, 0, dummynet, NULL,
+ C_HARDCLOCK | C_DIRECT_EXEC);
}
/*----- end of callout hooks -----*/
@@ -2159,12 +2161,12 @@ ip_dn_init(void)
DN_LOCK_INIT();
TASK_INIT(&dn_task, 0, dummynet_task, curvnet);
- dn_tq = taskqueue_create("dummynet", M_WAITOK,
+ dn_tq = taskqueue_create_fast("dummynet", M_WAITOK,
taskqueue_thread_enqueue, &dn_tq);
taskqueue_start_threads(&dn_tq, 1, PI_NET, "dummynet");
callout_init(&dn_timeout, CALLOUT_MPSAFE);
- callout_reset(&dn_timeout, 1, dummynet, NULL);
+ dn_reschedule();
/* Initialize curr_time adjustment mechanics. */
getmicrouptime(&dn_cfg.prev_t);
OpenPOWER on IntegriCloud