From owner-cvs-all Sun Sep 10 16:31: 6 2000 Delivered-To: cvs-all@freebsd.org Received: from tele-post-20.mail.demon.net (tele-post-20.mail.demon.net [194.217.242.20]) by hub.freebsd.org (Postfix) with ESMTP id 6E01937B423; Sun, 10 Sep 2000 16:31:01 -0700 (PDT) Received: from nlsys.demon.co.uk ([158.152.125.33] helo=herring.nlsystems.com) by tele-post-20.mail.demon.net with esmtp (Exim 2.12 #2) id 13YGYt-000OzK-0K; Sun, 10 Sep 2000 23:31:00 +0000 Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id AAA01297; Mon, 11 Sep 2000 00:32:08 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Mon, 11 Sep 2000 00:31:48 +0100 (BST) From: Doug Rabson To: John Baldwin Cc: Doug Rabson , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys ktr.h In-Reply-To: <200009102024.NAA24747@pike.osd.bsdi.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 10 Sep 2000, John Baldwin wrote: > Doug Rabson wrote: > > dfr 2000/09/10 07:36:55 PDT > > > > Modified files: > > sys/sys ktr.h > > Log: > > Use '&' instead of '%' to calculate the new value for ktr_idx. > > Err, it isn't guaranteed that KTR_ENTRIES will be a power of 2. If > it is, gcc should be optimizing the mod to a binary and though. As I mentioned to Brian, it can only reduce to a binary and if the numbers are known to be non-negative. Possibly changing the declaration of ktr_idx to an unsigned int would be enough but practically speaking, a non-power of 2 value for KTR_ENTRIES would be a disaster for performance. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 20 8348 3944 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message