From owner-freebsd-current Sun Feb 7 07:15:43 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA06070 for freebsd-current-outgoing; Sun, 7 Feb 1999 07:15:43 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from iquest3.iquest.net (iquest3.iquest.net [209.43.20.203]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id HAA06065 for ; Sun, 7 Feb 1999 07:15:36 -0800 (PST) (envelope-from toor@y.dyson.net) Received: (qmail 19669 invoked from network); 7 Feb 1999 15:15:33 -0000 Received: from dyson.iquest.net (HELO y.dyson.net) (198.70.144.127) by iquest3.iquest.net with SMTP; 7 Feb 1999 15:15:33 -0000 Received: (from root@localhost) by y.dyson.net (8.9.1/8.9.1) id KAA26836; Sun, 7 Feb 1999 10:15:31 -0500 (EST) Message-Id: <199902071515.KAA26836@y.dyson.net> Subject: Re: Significant page coloring improvement In-Reply-To: <199902071022.CAA20800@apollo.backplane.com> from Matthew Dillon at "Feb 7, 99 02:22:51 am" To: dillon@apollo.backplane.com (Matthew Dillon) Date: Sun, 7 Feb 1999 10:15:31 -0500 (EST) Cc: dyson@iquest.net, current@FreeBSD.ORG From: "John S. Dyson" Reply-To: dyson@iquest.net X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Matthew Dillon said: > > : next_index += PQ_L2_SIZE/4; > : if (next_index > PQ_L2_MASK) > : next_index = (next_index + 1) & PQ_L2_MASK; > > Oops, make that: > > next_index += PQ_L2_SIZE/4; > if (next_index > PQ_L2_MASK) > next_index = (next_index + PQ_PRIME1) & PQ_L2_MASK; > > Or even just: > > next_index = (next_index + PQ_PRIME1) & PQ_L2_MASK; > > Both seem to work pretty well w/ lmbench, though nothing really sticks > its nose out. > The reason why you might want to incr by PQ_L2_SIZE/N (or some other large number) is that it will likely decrease conflicts for larger objects. Note that the color should be chosen with more context (virtual address or memory region type like shared lib) than I originally implemented. There are better approaches that take into consideration dynamic conflicts. Such dynamic conflicts might be more complex to determine, and a good static choice adds only minimal overhead, yet provides some improvement. I suggest that until a major project can be undertaken, the static stuff is the right thing. It is easy to screw things up (as you can tell by my original choice for coloring being suboptimal, but not necessarily destructive.) I am agnostic regarding the coloring scheme, but I am glad that removing L1 coloring might be acceptable... If anything, it will decrease instruction cache footprint, and not cause a significant (hopefully any) decrease in performance. I will try to package up the patches (it is an issue of merging them in from my codebase.) They are essentially a result of hand optimizing the case of setting PQ_L1_SIZE to 1. Give me a day or so to put it together. -- John | Never try to teach a pig to sing, dyson@iquest.net | it makes one look stupid jdyson@nc.com | and it irritates the pig. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message