diff options
author | kib <kib@FreeBSD.org> | 2013-06-03 04:16:48 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-06-03 04:16:48 +0000 |
commit | 6e7fd639651595da1774be6c953050fdcc72eee5 (patch) | |
tree | 0124cdc11c4a24f6b495a10849344cecbffd60c3 /sys/kern | |
parent | e047d2d65ce2c5a19fdadeae38f512508444f993 (diff) | |
download | FreeBSD-src-6e7fd639651595da1774be6c953050fdcc72eee5.zip FreeBSD-src-6e7fd639651595da1774be6c953050fdcc72eee5.tar.gz |
When auto-sizing the buffer cache, limit the amount of physical memory
used as the estimation of size, to 32GB. This provides around 100K of
buffer headers and corresponding KVA for buffer map at the peak.
Sizing the cache larger is not useful, also resulting in the wasting
and exhausting of KVA for large machines.
Reported and tested by: bdrewery
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_bio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index ed51997..03ba78c 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -560,7 +560,8 @@ kern_vfs_bio_buffer_alloc(caddr_t v, long physmem_est) nbuf += min((physmem_est - 4096) / factor, 65536 / factor); if (physmem_est > 65536) - nbuf += (physmem_est - 65536) * 2 / (factor * 5); + nbuf += min((physmem_est - 65536) * 2 / (factor * 5), + 32 * 1024 * 1024 / (factor * 5)); if (maxbcache && nbuf > maxbcache / BKVASIZE) nbuf = maxbcache / BKVASIZE; |