From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 15:03:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA659106566B; Mon, 1 Jun 2009 15:03:58 +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 985048FC15; Mon, 1 Jun 2009 15:03:58 +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 n51F3wMF082276; Mon, 1 Jun 2009 15:03:58 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51F3wp5082274; Mon, 1 Jun 2009 15:03:58 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906011503.n51F3wp5082274@svn.freebsd.org> From: Robert Watson Date: Mon, 1 Jun 2009 15:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193230 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 15:03:59 -0000 Author: rwatson Date: Mon Jun 1 15:03:58 2009 New Revision: 193230 URL: http://svn.freebsd.org/changeset/base/193230 Log: Garbage collect NETISR_POLL and NETISR_POLLMORE, which are no longer required for options DEVICE_POLLING. De-fragment the NETISR_ constant space and lower NETISR_MAXPROT from 32 to 16 -- when sizing queue arrays using this compile-time constant, significant amounts of memory are saved. Warn on the console when tunable values for netisr are automatically adjusted during boot due to exceeding limits, invalid values, or as a result of DEVICE_POLLING. Modified: head/sys/net/netisr.c head/sys/net/netisr.h Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Mon Jun 1 14:20:13 2009 (r193229) +++ head/sys/net/netisr.c Mon Jun 1 15:03:58 2009 (r193230) @@ -201,7 +201,7 @@ struct netisr_proto { u_int np_policy; /* Work placement policy. */ }; -#define NETISR_MAXPROT 32 /* Compile-time limit. */ +#define NETISR_MAXPROT 16 /* Compile-time limit. */ /* * The np array describes all registered protocols, indexed by protocol @@ -1045,20 +1045,31 @@ netisr_init(void *arg) KASSERT(curcpu == 0, ("%s: not on CPU 0", __func__)); NETISR_LOCK_INIT(); - if (netisr_maxthreads < 1) + if (netisr_maxthreads < 1) { + printf("netisr2: forcing maxthreads to 1\n"); netisr_maxthreads = 1; - if (netisr_maxthreads > MAXCPU) + } + if (netisr_maxthreads > MAXCPU) { + printf("netisr2: forcing maxthreads to %d\n", MAXCPU); netisr_maxthreads = MAXCPU; - if (netisr_defaultqlimit > netisr_maxqlimit) + } + if (netisr_defaultqlimit > netisr_maxqlimit) { + printf("netisr2: forcing defaultqlimit to %d\n", + netisr_maxqlimit); netisr_defaultqlimit = netisr_maxqlimit; + } #ifdef DEVICE_POLLING /* * The device polling code is not yet aware of how to deal with * multiple netisr threads, so for the time being compiling in device * polling disables parallel netisr workers. */ - netisr_maxthreads = 1; - netisr_bindthreads = 0; + if (netisr_maxthreads != 1 || netisr_bindthreads != 0) { + printf("netisr2: forcing maxthreads to 1 and bindthreads to " + "0 for device polling\n"); + netisr_maxthreads = 1; + netisr_bindthreads = 0; + } #endif netisr_start_swi(curcpu, pcpu_find(curcpu)); Modified: head/sys/net/netisr.h ============================================================================== --- head/sys/net/netisr.h Mon Jun 1 14:20:13 2009 (r193229) +++ head/sys/net/netisr.h Mon Jun 1 15:03:58 2009 (r193230) @@ -39,19 +39,17 @@ * Historically, this was implemented by the BSD software ISR facility; it is * now implemented via a software ithread (SWI). */ -#define NETISR_POLL 0 /* polling callback, must be first */ -#define NETISR_IP 2 /* same as AF_INET */ -#define NETISR_IGMP 3 /* IGMPv3 output queue */ -#define NETISR_ROUTE 14 /* routing socket */ -#define NETISR_AARP 15 /* Appletalk ARP */ -#define NETISR_ATALK2 16 /* Appletalk phase 2 */ -#define NETISR_ATALK1 17 /* Appletalk phase 1 */ -#define NETISR_ARP 18 /* same as AF_LINK */ -#define NETISR_IPX 23 /* same as AF_IPX */ -#define NETISR_ETHER 24 /* ethernet input */ -#define NETISR_IPV6 27 -#define NETISR_NATM 28 -#define NETISR_POLLMORE 31 /* polling callback, must be last */ +#define NETISR_IP 1 +#define NETISR_IGMP 2 /* IGMPv3 output queue */ +#define NETISR_ROUTE 3 /* routing socket */ +#define NETISR_AARP 4 /* Appletalk ARP */ +#define NETISR_ATALK2 5 /* Appletalk phase 2 */ +#define NETISR_ATALK1 6 /* Appletalk phase 1 */ +#define NETISR_ARP 7 /* same as AF_LINK */ +#define NETISR_IPX 8 /* same as AF_IPX */ +#define NETISR_ETHER 9 /* ethernet input */ +#define NETISR_IPV6 10 +#define NETISR_NATM 11 /*- * Protocols express ordering constraints and affinity preferences by