diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-07-27 20:33:24 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-07-27 20:33:24 +0000 |
commit | 6efc69427c175cba562ef9236baba23594edbac7 (patch) | |
tree | 3f204bdae5632ee71fcfce44c62494fdc26d634c /sys/arch/sparc64 | |
parent | 64148ef601a4b35e669b7545d0d9ceab9f40faad (diff) |
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.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/sparc64/pmap.c | 18 |
1 files changed, 10 insertions, 8 deletions
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 |