From owner-freebsd-current@FreeBSD.ORG Fri Apr 20 12:48:06 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F16621065670; Fri, 20 Apr 2012 12:48:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id C5CAA8FC0C; Fri, 20 Apr 2012 12:48:06 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 39D58B924; Fri, 20 Apr 2012 08:48:06 -0400 (EDT) From: John Baldwin To: freebsd-net@freebsd.org Date: Fri, 20 Apr 2012 08:11:44 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <20120419133018.GA91364@onelab2.iet.unipi.it> <4F907011.9080602@freebsd.org> <20120419204622.GA94904@onelab2.iet.unipi.it> In-Reply-To: <20120419204622.GA94904@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201204200811.44957.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 20 Apr 2012 08:48:06 -0400 (EDT) Cc: Andre Oppermann , Luigi Rizzo , current@freebsd.org, net@freebsd.org Subject: Re: Some performance measurements on the FreeBSD network stack X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2012 12:48:07 -0000 On Thursday, April 19, 2012 4:46:22 pm Luigi Rizzo wrote: > What might be moderately expensive are the critical_enter()/critical_exit() > calls around individual allocations. > The allocation happens while the code has already an exclusive > lock on so->snd_buf so a pool of fresh buffers could be attached > there. Keep in mind that in the common case critical_enter() and critical_exit() should be very cheap as they should just do td->td_critnest++ and td->td_critnest--. critical_enter() should probably be inlined if KTR is not enabled. -- John Baldwin