diff options
author | dillon <dillon@FreeBSD.org> | 2001-08-20 00:41:12 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2001-08-20 00:41:12 +0000 |
commit | 05c33a209bd0403f851f4ffd54fe4d16a1a663ef (patch) | |
tree | 4f3fc469468f6ff18e20f33a23a0fca03e1113be /sys/amd64 | |
parent | 277945b1a7db16235f31ed390e6a74045bd62b5f (diff) | |
download | FreeBSD-src-05c33a209bd0403f851f4ffd54fe4d16a1a663ef.zip FreeBSD-src-05c33a209bd0403f851f4ffd54fe4d16a1a663ef.tar.gz |
Limit the amount of KVM reserved for the buffer cache and for swap-meta
information. The default limits only effect machines with > 1GB of ram
and can be overriden with two new kernel conf variables VM_SWZONE_SIZE_MAX
and VM_BCACHE_SIZE_MAX, or with loader variables kern.maxswzone and
kern.maxbcache. This has the effect of leaving more KVM available for
sizing NMBCLUSTERS and 'maxusers' and should avoid tripups where a sysad
adds memory to a machine and then sees the kernel panic on boot due to
running out of KVM.
Also change the default swap-meta auto-sizing calculation to allocate half
of what it was previously allocating. The prior defaults were way too high.
Note that we cannot afford to run out of swap-meta structures so we still
stay somewhat conservative here.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/machdep.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 489e277..7bc1d3d 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -299,7 +299,9 @@ again: * 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 - * buffers to cover 1/20 of our ram over 64MB. + * buffers to cover 1/20 of our ram over 64MB. When auto-sizing + * the buffer cache we limit the eventual kva reservation to + * maxbcache bytes. * * factor represents the 1/4 x ram conversion. */ @@ -312,6 +314,9 @@ again: 16384 / factor); if (physmem_est > 16384) nbuf += (physmem_est - 16384) * 2 / (factor * 5); + + if (maxbcache && nbuf > physmem_est / BKVASIZE) + nbuf = maxbcache / BKVASIZE; } /* |