From owner-cvs-all Thu Aug 15 22:25: 5 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 628AE37B401; Thu, 15 Aug 2002 22:25:02 -0700 (PDT) Received: from root.com (unknown [209.102.106.178]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D16B43E6E; Thu, 15 Aug 2002 22:25:01 -0700 (PDT) (envelope-from dg@root.com) Received: (from dg@localhost) by root.com (8.11.2/8.11.2) id g7G5G9Q50657; Thu, 15 Aug 2002 22:16:09 -0700 (PDT) (envelope-from dg) Date: Thu, 15 Aug 2002 22:16:09 -0700 From: David Greenman-Lawrence To: David Greenman Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_socket2.c Message-ID: <20020815221609.E42978@nexus.root.com> References: <200208160508.g7G58kRZ098250@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200208160508.g7G58kRZ098250@freefall.freebsd.org>; from dg@FreeBSD.org on Thu, Aug 15, 2002 at 10:08:46PM -0700 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >dg 2002/08/15 22:08:46 PDT > > Modified files: > sys/kern uipc_socket2.c > Log: > Rewrote the space check algorithm in sbreserve() so that the extremely > expensive (!) 64bit multiply, divide, and comparison aren't necessary ... > The 64bit math in this function was measured in some kernel profiles as > being as much as 5-8% of the total overhead of the TCP/IP stack and I'm looking at calcru() as well, since is does four 64bit divides and was as expensive as sbreserve() in my profiles. The __qdivrem function that does the 64bit divide appears to consume several thousand instructions in the common case. Something to avoid if at all possible. -DG D.G.Lawrence Download Technologies, Inc. - http://www.downloadtech.com - (866) 399 8500 TeraSolutions, Inc. - http://www.terasolutions.com - (503) 288 9544 The FreeBSD Project - http://www.freebsd.org Pave the road of life with opportunities. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message