From 6efc69427c175cba562ef9236baba23594edbac7 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 27 Jul 2008 20:33:24 +0000 Subject: 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. --- sys/arch/sparc64/sparc64/pmap.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'sys/arch/sparc64') 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 -- cgit v1.2.3