Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F158012640
D2318.id4887.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D2318.id4887.diff
View Options
Index: sys/net/netisr.c
===================================================================
--- sys/net/netisr.c
+++ sys/net/netisr.c
@@ -156,10 +156,13 @@
/*
* Allow the administrator to limit the number of threads (CPUs) to use for
* netisr. We don't check netisr_maxthreads before creating the thread for
- * CPU 0, so in practice we ignore values <= 1. This must be set at boot.
- * We will create at most one thread per CPU.
+ * CPU 0. This must be set at boot. We will create at most one thread per CPU.
+ * By default we initialize this to 0 which would assign just 1 cpu (cpu0) and
+ * therefore only 1 workstream. If set to -1, netisr would use all cpus
+ * (mp_ncpus) and therefore would have those many workstreams. One workstream
+ * per thread (CPU).
*/
-static int netisr_maxthreads = -1; /* Max number of threads. */
+static int netisr_maxthreads = 0; /* Max number of threads. */
SYSCTL_INT(_net_isr, OID_AUTO, maxthreads, CTLFLAG_RDTUN,
&netisr_maxthreads, 0,
"Use at most this many CPUs for netisr processing");
@@ -1120,8 +1123,10 @@
KASSERT(curcpu == 0, ("%s: not on CPU 0", __func__));
NETISR_LOCK_INIT();
- if (netisr_maxthreads < 1)
+ if (netisr_maxthreads == 0) /* default behavior */
netisr_maxthreads = 1;
+ else if (netisr_maxthreads == -1) /* use max cpus */
+ netisr_maxthreads = mp_ncpus;
if (netisr_maxthreads > mp_ncpus) {
printf("netisr_init: forcing maxthreads from %d to %d\n",
netisr_maxthreads, mp_ncpus);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 28, 11:58 AM (13 m, 13 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33585427
Default Alt Text
D2318.id4887.diff (1 KB)
Attached To
Mode
D2318: Propose a way to specify all available cpus as net.isr.maxthreads.
Attached
Detach File
Event Timeline
Log In to Comment