From owner-cvs-all Thu Aug 15 23:53:19 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 2FE1C37B400; Thu, 15 Aug 2002 23:53:16 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5DDF143E72; Thu, 15 Aug 2002 23:53:15 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.3/8.12.2) with ESMTP id g7G6o0Ro008516; Fri, 16 Aug 2002 08:50:02 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: David Greenman-Lawrence Cc: Alfred Perlstein , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_socket2.c In-Reply-To: Your message of "Thu, 15 Aug 2002 22:32:11 PDT." <20020815223211.F42978@nexus.root.com> Date: Fri, 16 Aug 2002 08:50:00 +0200 Message-ID: <8515.1029480600@critter.freebsd.dk> From: Poul-Henning Kamp 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 In message <20020815223211.F42978@nexus.root.com>, David Greenman-Lawrence writ es: >>> 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. > > Hmmm...not sure if I'm following you. The 64bit math happens when quad >variables are involved in the divide. It might be possible to come up with >an optimization to qdivrem (and similar functions) that check the dividend >and divisor to see if the two values are less than 32 bits large, and then >do a standard 32bit/32bit hardware divide. I think this might catch a vary >common case where 64bit math wasn't really needed and save a few thousand >instructions as a result. > Calcru() is a tough critter - it would be real nice if Bruce (or anyone) >could give me some thoughts on that. We may have arrived at the point where it is cheaper to timestamp at all boundary conditions instead of doing statistical redistribution. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message