From owner-cvs-all Thu Aug 15 22:27:30 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 05BCA37B400; Thu, 15 Aug 2002 22:27:27 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAE9243E6A; Thu, 15 Aug 2002 22:27:26 -0700 (PDT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 95269AE279; Thu, 15 Aug 2002 22:27:26 -0700 (PDT) Date: Thu, 15 Aug 2002 22:27:26 -0700 From: Alfred Perlstein To: David Greenman-Lawrence Cc: David Greenman , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_socket2.c Message-ID: <20020816052726.GN75574@elvis.mu.org> References: <200208160508.g7G58kRZ098250@freefall.freebsd.org> <20020815221609.E42978@nexus.root.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020815221609.E42978@nexus.root.com> User-Agent: Mutt/1.3.27i 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 * David Greenman-Lawrence [020815 22:25] wrote: > >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. Any idea on how to setup warnings when some threshold of 64 bit math is reached? I know this entirely arbitrary, but it would be interesting and obviously benificial if we could easily find and fix more instances of this in a somewhat automated fashion. -- -Alfred Perlstein [alfred@freebsd.org] [#bsdcode/efnet/irc.prison.net] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message