increasing number of buffers in BSD4.4

David Schultz das at FreeBSD.ORG
Thu Aug 14 15:31:05 PDT 2003


On Thu, Aug 14, 2003, Eno Thereska wrote:
> In McKusick's book "The design and Implementation of the 4.4BSD 
> Operating system", in the "Buffer Management subsection
> of the I/O system overview, there is a a sentence that says
> "...depending on available memory, a system is configured with from
> 100 to 1000 buffers.." referring to the number of struct buf* in the
> integrated VM/IO buffer cache.
> 
> I have plenty of RAM in my computer, but it seems like there are always
> 1000 buffers configured (empirical observation, if I try to allocate
> one more after that the system freezes). How do I increase the nubmer of
> buffers? More consicely, how do I allocate more memory to the buffer 
> management subsystem?

In FreeBSD, you get 1 buffer for every megabyte of memory up to 64
MB of RAM, and 1 buffer for every 2.5 megabytes after that.  See
kern_vfs_bio_buffer_alloc() in vfs_bio.c.  On i386 and amd64,
there's a cap of about 1000 due to KVA limits, although that cap
should not be needed for amd64.


More information about the freebsd-hackers mailing list