From: kettenis Date: Sun, 27 Jul 2008 20:33:23 +0000 (+0000) Subject: Increase the size of the TSB on large memory machines. This make building X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6e5b2c13b3af99b408235034aeecd6f6f3559c40;p=openbsd Increase the size of the TSB on large memory machines. This make building a kernel 10-15% faster on the t1k. Don't do this for SMALL_KERNEL though, otherwise the 4MB locked mapping for the data segment will be too small to include a ramdisk. --- diff --git a/sys/arch/sparc64/sparc64/pmap.c b/sys/arch/sparc64/sparc64/pmap.c index 1bc33e07f67..4412a94ddf9 100644 --- a/sys/arch/sparc64/sparc64/pmap.c +++ b/sys/arch/sparc64/sparc64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.66 2008/07/25 19:37:16 kettenis Exp $ */ +/* $OpenBSD: pmap.c,v 1.67 2008/07/27 20:33:23 kettenis Exp $ */ /* $NetBSD: pmap.c,v 1.107 2001/08/31 16:47:41 eeh Exp $ */ #undef NO_VCACHE /* Don't forget the locked TLB in dostart */ /* @@ -845,15 +845,17 @@ remap_data: physmem += atop(mp->size); BDPRINTF(PDB_BOOT1, (" result %x or %d pages\r\n", (int)physmem, (int)physmem)); + /* - * Calculate approx TSB size. This probably needs tweaking. + * Calculate approx TSB size. */ - if (physmem < atop(64 * 1024 * 1024)) - tsbsize = 0; - else if (physmem < atop(512 * 1024 * 1024)) - tsbsize = 1; - else - tsbsize = 2; + tsbsize = 0; +#ifdef SMALL_KERNEL + while ((physmem >> tsbsize) > atop(64 * MEG) && tsbsize < 2) +#else + while ((physmem >> tsbsize) > atop(64 * MEG) && tsbsize < 7) +#endif + tsbsize++; /* * Save the prom translations