kern/165444: [netisr] [patch] incorrect processing of net.isr.bindthreads=0

Eugene Grosbein eugen at
Fri Feb 24 11:10:05 UTC 2012

>Number:         165444
>Category:       kern
>Synopsis:       [netisr] [patch] incorrect processing of net.isr.bindthreads=0
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 24 11:10:04 UTC 2012
>Originator:     Eugene Grosbein
>Release:        FreeBSD 8.2-STABLE i386
System: FreeBSD 8.2-STABLE FreeBSD 8.2-STABLE #37: Wed Feb 15 14:22:03 NOVT 2012 root at i386


	I've tried to use loader tunnable 'net.isr.bindthreads=0'
	for 4-core router. Sometimes each of 4 NETISR kernel threads get
	full cpu mask 0,1,2,3 but sometimes some NETISR threads get bound
	to CPU3 only.

	See also:


	See above. The effect is random.


	To ensure correct processing of tunnable, small correction is needed,
	something like this:

--- sys/net/netisr.c.orig	2012-02-24 17:45:37.000000000 +0700
+++ sys/net/netisr.c	2012-02-24 17:47:52.000000000 +0700
@@ -980,12 +980,10 @@
 	if (error)
 		panic("%s: swi_add %d", __func__, error);
 	pc->pc_netisr = nwsp->nws_intr_event;
-	if (netisr_bindthreads) {
-		error = intr_event_bind(nwsp->nws_intr_event, cpuid);
+		error = intr_event_bind(nwsp->nws_intr_event, netisr_bindthreads ? cpuid : NOCPU);
 		if (error != 0)
 			printf("%s: cpu %u: intr_event_bind: %d", __func__,
 			    cpuid, error);
-	}
 	nws_array[nws_count] = nwsp->nws_cpu;


More information about the freebsd-bugs mailing list