netisr_direct
Robert Watson
rwatson at FreeBSD.org
Sat Mar 10 03:54:54 UTC 2007
University of Cambridge
On Thu, 8 Mar 2007, Dave Baukus wrote:
> What's the word on netisr_direct ? Do people typically enable this feature ?
Direct dispatch is the default configuration for the network stack in FreeBSD
7.x. Many users have reported performance improvements, especially in high
packets-per-second receive environments. However, some users have reported
performance loss on some SMP systems with some workloads. Direct dispatch
will generally significantly lower the overhead of in-bound packet processing
in the network stack by avoiding context switches. It also introduces
parallelism in the in-bound network layer processing path by allowing
processing to occur in more than one thread at a time. However, you can see
reduced parallelism in some environments as the ithread no longer run
concurrently with the netisr. I would not use net.isr.direct in versions of
FreeBSD before 6.1, but it should be pretty safe for 6.1 and later.
Robert N M Watson
Computer Laboratory
University of Cambridge
>
> net/netisr.c:
> static int netisr_direct = 0;
> SYSCTL_INT(_net_isr, OID_AUTO, direct, CTLFLAG_RW,
> &netisr_direct, 0, "enable direct dispatch");
> TUNABLE_INT("net.isr.direct", &netisr_direct);
>
>
> /*
> * Do direct dispatch only for MPSAFE netisrs (and
> * only when enabled). Note that when a netisr is
> * marked MPSAFE we permit multiple concurrent instances
> * to run. We guarantee only the order in which
> * packets are processed for each "dispatch point" in
> * the system (i.e. call to netisr_dispatch or
> * netisr_queue). This insures ordering of packets
> * from an interface but does not guarantee ordering
> * between multiple places in the system (e.g. IP
> * dispatched from interfaces vs. IP queued from IPSec).
> */
> if (netisr_direct && (ni->ni_flags & NETISR_MPSAFE)) {
> isrstat.isrs_directed++;
> /*
> * NB: We used to drain the queue before handling
> * the packet but now do not. Doing so here will
> * not preserve ordering so instead we fallback to
> * guaranteeing order only from dispatch points
> * in the system (see above).
> */
> ni->ni_handler(m);
>
> --
> Dave Baukus
> david.baukus at us.fujitsu.com
> 972-479-2491
>
> Fujitsu Network Communications
> Richardson, Texas
> USA
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>
More information about the freebsd-net
mailing list