From owner-freebsd-hackers Sun Jun 25 18:18:11 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from granger.mail.mindspring.net (granger.mail.mindspring.net [207.69.200.148]) by hub.freebsd.org (Postfix) with ESMTP id 275D837B60D; Sun, 25 Jun 2000 18:17:55 -0700 (PDT) (envelope-from kbyanc@posi.net) Received: from gateway.posi.net (user-33qtkm5.dialup.mindspring.com [199.174.210.197]) by granger.mail.mindspring.net (8.9.3/8.8.5) with ESMTP id VAA27785; Sun, 25 Jun 2000 21:17:50 -0400 (EDT) Received: from localhost (kbyanc@localhost) by gateway.posi.net (8.9.3/8.9.3) with ESMTP id SAA01680; Sun, 25 Jun 2000 18:17:44 -0700 (PDT) (envelope-from kbyanc@posi.net) Date: Sun, 25 Jun 2000 18:17:43 -0700 (PDT) From: Kelly Yancey To: John Baldwin Cc: Motomichi Matsuzaki , freebsd-hackers@FreeBSD.ORG Subject: RE: VM coloring description in NOTES In-Reply-To: <200006251907.MAA03026@john.baldwin.cx> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 25 Jun 2000, John Baldwin wrote: > > currently -> candidate > > PQ_HUGECACHE PQ_CACHE1024 > > PQ_LARGECACHE PQ_CACHE512 > > PQ_MEDIUMCACHE PQ_CACHE256 > > PQ_NORMALCACHE PQ_CACHE64 > > > > and newly PQ_CACHE128 should be defined as default. > > > > Any ideas? > > Sounds ok to me. Do you have any patches for this? If not, > I'll make some and see if they pass muster. > John, I've actually got something similar I worked up a while back on my local machine. It's not exactly the same (you set PQ_CACHESIZE to the value of your L2 cache as opposed to having multiple #defines/config options). I just cleaned it up and added backward-compatibility with the pre-existing PQ_ options so as to not break anyone's config files. :) Patches are attached below. I can only say that they've been working on my 4.0-STABLE machines for a few weeks. Kelly -- Kelly Yancey - kbyanc@posi.net - Belmont, CA System Administrator, eGroups.com http://www.egroups.com/ Maintainer, BSD Driver Database http://www.posi.net/freebsd/drivers/ Coordinator, Team FreeBSD http://www.posi.net/freebsd/Team-FreeBSD/ --- sys/vm/vm_page.h.orig Sun Jun 25 17:52:37 2000 +++ sys/vm/vm_page.h Sun Jun 25 18:13:45 2000 @@ -150,46 +150,51 @@ */ /* Each of PQ_FREE, and PQ_CACHE have PQ_HASH_SIZE entries */ -/* Define one of the following */ +/* Backward compatibility for existing PQ_*CACHE config options. */ +#if !defined(PQ_CACHESIZE) #if defined(PQ_HUGECACHE) +#define PQ_CACHESIZE 1024 +#elsif defined(PQ_LARGECACHE) +#define PQ_CACHESIZE 512 +#elsif defined(PQ_MEDIUMCACHE) +#define PQ_CACHESIZE 256 +#elsif defined(PQ_NORMALCACHE) +#define PQ_CACHESIZE 64 +#else +#define PQ_CACHESIZE 0 +#endif +#endif + +#if PQ_CACHESIZE >= 1024 #define PQ_PRIME1 31 /* Prime number somewhat less than PQ_HASH_SIZE */ #define PQ_PRIME2 23 /* Prime number somewhat less than PQ_HASH_SIZE */ #define PQ_L2_SIZE 256 /* A number of colors opt for 1M cache */ -#endif -/* Define one of the following */ -#if defined(PQ_LARGECACHE) +#elsif PQ_CACHESIZE >= 512 #define PQ_PRIME1 31 /* Prime number somewhat less than PQ_HASH_SIZE */ #define PQ_PRIME2 23 /* Prime number somewhat less than PQ_HASH_SIZE */ #define PQ_L2_SIZE 128 /* A number of colors opt for 512K cache */ -#endif +#elsif PQ_CACHESIZE >= 256 +#define PQ_PRIME1 13 /* Prime number somewhat less than PQ_HASH_SIZE */ +#define PQ_PRIME2 7 /* Prime number somewhat less than PQ_HASH_SIZE */ +#define PQ_L2_SIZE 64 /* A number of colors opt for 256K cache */ -/* - * Use 'options PQ_NOOPT' to disable page coloring - */ -#if defined(PQ_NOOPT) -#define PQ_PRIME1 1 -#define PQ_PRIME2 1 -#define PQ_L2_SIZE 1 -#endif +#elsif PQ_CACHESIZE >= 128 +#define PQ_PRIME1 9 /* Produces a good PQ_L2_SIZE/3 + PQ_PRIME1 */ +#define PQ_PRIME2 5 /* Prime number somewhat less than PQ_HASH_SIZE */ +#define PQ_L2_SIZE 32 /* A number of colors opt for 128k cache */ -#if defined(PQ_NORMALCACHE) +#elsif PQ_CACHESIZE >= 64 #define PQ_PRIME1 5 /* Prime number somewhat less than PQ_HASH_SIZE */ #define PQ_PRIME2 3 /* Prime number somewhat less than PQ_HASH_SIZE */ #define PQ_L2_SIZE 16 /* A reasonable number of colors (opt for 64K cache) */ -#endif -#if defined(PQ_MEDIUMCACHE) -#define PQ_PRIME1 13 /* Prime number somewhat less than PQ_HASH_SIZE */ -#define PQ_PRIME2 7 /* Prime number somewhat less than PQ_HASH_SIZE */ -#define PQ_L2_SIZE 64 /* A number of colors opt for 256K cache */ -#endif +#else +#define PQ_PRIME1 1 /* Disable page coloring. */ +#define PQ_PRIME2 1 +#define PQ_L2_SIZE 1 -#if !defined(PQ_L2_SIZE) -#define PQ_PRIME1 9 /* Produces a good PQ_L2_SIZE/3 + PQ_PRIME1 */ -#define PQ_PRIME2 5 /* Prime number somewhat less than PQ_HASH_SIZE */ -#define PQ_L2_SIZE 32 /* 512KB or smaller, 4-way set-associative cache */ #endif #define PQ_L2_MASK (PQ_L2_SIZE - 1) --- sys/conf/options.orig Sun Jun 25 18:08:22 2000 +++ sys/conf/options Sun Jun 25 18:14:11 2000 @@ -364,6 +364,7 @@ PQ_MEDIUMCACHE opt_vmpage.h PQ_LARGECACHE opt_vmpage.h PQ_HUGECACHE opt_vmpage.h +PQ_CACHESIZE opt_vmpage.h # Standard SMP options SMP opt_global.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message