From owner-svn-src-projects@FreeBSD.ORG Wed May 13 12:19:54 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B0B6106566B; Wed, 13 May 2009 12:19:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 793088FC0C; Wed, 13 May 2009 12:19:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4DCJspH056138; Wed, 13 May 2009 12:19:54 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4DCJsmo056137; Wed, 13 May 2009 12:19:54 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200905131219.n4DCJsmo056137@svn.freebsd.org> From: Robert Watson Date: Wed, 13 May 2009 12:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192039 - projects/pnet/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2009 12:19:54 -0000 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);