svn commit: r192039 - projects/pnet/sys/net
Robert Watson
rwatson at FreeBSD.org
Wed May 13 12:19:54 UTC 2009
Author: rwatson
Date: Wed May 13 12:19:54 2009
New Revision: 192039
URL: http://svn.freebsd.org/changeset/base/192039
Log:
Create at most one thread by default -- we want this to be a drop-in
replacement for netisr1 in 8.0, so don't want to deal with full
performance evaluation of the MP case yet.
Add a tunable/sysctl to disable binding threads to CPUs, and set that
by default, as we'll be using just one netisr by default.
Modified:
projects/pnet/sys/net/netisr2.c
Modified: projects/pnet/sys/net/netisr2.c
==============================================================================
--- projects/pnet/sys/net/netisr2.c Wed May 13 10:16:31 2009 (r192038)
+++ projects/pnet/sys/net/netisr2.c Wed May 13 12:19:54 2009 (r192039)
@@ -132,11 +132,16 @@ SYSCTL_INT(_net_isr2, OID_AUTO, direct,
* thread for CPU 0, so in practice we ignore values <= 1. This must be set
* as a tunable, no run-time reconfiguration yet.
*/
-static int netisr_maxthreads = MAXCPU; /* Bound number of threads. */
+static int netisr_maxthreads = 1; /* Max number of threads. */
TUNABLE_INT("net.isr2.maxthreads", &netisr_maxthreads);
SYSCTL_INT(_net_isr2, OID_AUTO, maxthreads, CTLFLAG_RD, &netisr_maxthreads,
0, "Use at most this many CPUs for netisr2 processing");
+static int netisr_bindthreads = 0; /* Bind threads to CPUs. */
+TUNABLE_INT("net.isr2.bindthreads", &netisr_bindthreads);
+SYSCTL_INT(_net_isr2, OID_AUTO, bindthreads, CTLFLAG_RD, &netisr_bindthreads,
+ 0, "Bind netisr2 threads to CPUs.");
+
/*
* Each protocol is described by an instance of netisr_proto, which holds all
* global per-protocol information. This data structure is set up by
@@ -511,7 +516,7 @@ swi_net(void *arg)
* On first execution, force the ithread to the desired CPU. There
* should be a better way to do this.
*/
- if (!(nwsp->nws_swi_flags & NWS_SWI_BOUND)) {
+ if (netisr_bindthreads && !(nwsp->nws_swi_flags & NWS_SWI_BOUND)) {
thread_lock(curthread);
sched_bind(curthread, nwsp->nws_cpu);
thread_unlock(curthread);
More information about the svn-src-projects
mailing list