From owner-freebsd-current Thu Jul 30 22:27:02 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA03685 for freebsd-current-outgoing; Thu, 30 Jul 1998 22:27:02 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from dyson.iquest.net (dyson.iquest.net [198.70.144.127]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA03674 for ; Thu, 30 Jul 1998 22:26:56 -0700 (PDT) (envelope-from toor@dyson.iquest.net) Received: (from root@localhost) by dyson.iquest.net (8.8.8/8.8.8) id AAA26521; Fri, 31 Jul 1998 00:26:28 -0500 (EST) (envelope-from toor) Message-Id: <199807310526.AAA26521@dyson.iquest.net> Subject: Re: using vm_page.h in userland program In-Reply-To: <199807300833.SAA05989@godzilla.zeta.org.au> from Bruce Evans at "Jul 30, 98 06:33:38 pm" To: bde@zeta.org.au (Bruce Evans) Date: Fri, 31 Jul 1998 00:26:28 -0500 (EST) Cc: current@FreeBSD.ORG, luoqi@chen.ml.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 Bruce Evans said: > >Recent change (addition of cache coloring) to vm/vm_page.h has made it > >impossible to use this header file in a userland program. It tries to > >include "opt_vmpage.h" unconditionally. IMO, "opt_vmpage.h" should only > >be included when KERNEL is defined. Would someone please make the change? > .... > > > The cache coloring options should be dynamic anyway. I have tried a few > different values on various machines but didn't notice much difference > and didn't have time to do careful comparisons. > The cache coloring tuning itself was on my list, and not really hard to do. It should also have a machine dependent component, and also query the processor, if it can, for info. The work to make the coloring dynamic is just a coding effort. The biggest issue (AFAIR) is that the current code is fairly efficient because of the inline usage of nice, power of two values. By making things dynamic, it is tricky to keep efficiency high. The additional overhead of doing the coloring might make it undesirable. It isn't necessary for the coloring to be "perfect" either, so it is okay to color a 256K cache system as if it is a 512K cache machine. Some coloring algorithms would become less efficient, but the FreeBSD one is okay with it. The coloring scheme that I chose for FreeBSD doesn't have the disadvantage of other, typical algorithms by being inflexible when memory of a certain color isn't available. Note that the micro-level coloring is really good, but the macro-level coloring could use some work. (The choice of the color for each object should be revisited.) Page coloring is awfully hard to benchmark. The only "quick" benchmark that I had was lmbench, lat_mem_rd. Page coloring mostly helps the system avoid "worst case" behavior, but to gain a sustained significant performance improvement is not likely. -- 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