diff options
author | kato <kato@FreeBSD.org> | 2000-12-16 03:25:08 +0000 |
---|---|---|
committer | kato <kato@FreeBSD.org> | 2000-12-16 03:25:08 +0000 |
commit | 336f3a8924117b1567523aa8cbd07b7c7b48605e (patch) | |
tree | 742466380053d6e1d45ef40bbffe9d4bfb8eb98e | |
parent | c62e8f41063be37c928407d14a5c173f6440f018 (diff) | |
download | FreeBSD-src-336f3a8924117b1567523aa8cbd07b7c7b48605e.zip FreeBSD-src-336f3a8924117b1567523aa8cbd07b7c7b48605e.tar.gz |
Merged from sys/i386/i386/machdep.c revision 1.425.
-rw-r--r-- | sys/pc98/i386/machdep.c | 19 | ||||
-rw-r--r-- | sys/pc98/pc98/machdep.c | 19 |
2 files changed, 30 insertions, 8 deletions
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index 8158e79..9b1938b 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -274,6 +274,7 @@ cpu_startup(dummy) vm_size_t size = 0; int firstaddr; vm_offset_t minaddr; + int physmem_est; if (boothowto & RB_VERBOSE) bootverbose++; @@ -343,6 +344,16 @@ again: valloc(callwheel, struct callout_tailq, callwheelsize); /* + * Discount the physical memory larger than the size of kernel_map + * to avoid eating up all of KVA space. + */ + if (kernel_map->first_free == NULL) { + printf("Warning: no free entries in kernel_map.\n"); + physmem_est = physmem; + } else + physmem_est = min(physmem, kernel_map->max_offset - kernel_map->min_offset); + + /* * The nominal buffer size (and minimum KVA allocation) is BKVASIZE. * For the first 64MB of ram nominally allocate sufficient buffers to * cover 1/4 of our ram. Beyond the first 64MB allocate additional @@ -354,10 +365,10 @@ again: int factor = 4 * BKVASIZE / PAGE_SIZE; nbuf = 50; - if (physmem > 1024) - nbuf += min((physmem - 1024) / factor, 16384 / factor); - if (physmem > 16384) - nbuf += (physmem - 16384) * 2 / (factor * 5); + if (physmem_est > 1024) + nbuf += min((physmem_est - 1024) / factor, 16384 / factor); + if (physmem_est > 16384) + nbuf += (physmem_est - 16384) * 2 / (factor * 5); } /* diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 8158e79..9b1938b 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -274,6 +274,7 @@ cpu_startup(dummy) vm_size_t size = 0; int firstaddr; vm_offset_t minaddr; + int physmem_est; if (boothowto & RB_VERBOSE) bootverbose++; @@ -343,6 +344,16 @@ again: valloc(callwheel, struct callout_tailq, callwheelsize); /* + * Discount the physical memory larger than the size of kernel_map + * to avoid eating up all of KVA space. + */ + if (kernel_map->first_free == NULL) { + printf("Warning: no free entries in kernel_map.\n"); + physmem_est = physmem; + } else + physmem_est = min(physmem, kernel_map->max_offset - kernel_map->min_offset); + + /* * The nominal buffer size (and minimum KVA allocation) is BKVASIZE. * For the first 64MB of ram nominally allocate sufficient buffers to * cover 1/4 of our ram. Beyond the first 64MB allocate additional @@ -354,10 +365,10 @@ again: int factor = 4 * BKVASIZE / PAGE_SIZE; nbuf = 50; - if (physmem > 1024) - nbuf += min((physmem - 1024) / factor, 16384 / factor); - if (physmem > 16384) - nbuf += (physmem - 16384) * 2 / (factor * 5); + if (physmem_est > 1024) + nbuf += min((physmem_est - 1024) / factor, 16384 / factor); + if (physmem_est > 16384) + nbuf += (physmem_est - 16384) * 2 / (factor * 5); } /* |