

To speed lookup access, buffers are linked onto hash
queues. The number of these is controlled by the NHBUF
parameter. The average number of buffers per queue is the total
number of buffers, NBUF, divided by the number of hash
queues.
The greater the number of hash queues, the
fewer the number of buffers that will exist
on any given hash queue on average.
Keeping the ratio of hash queues to buffers low reduces contention for SMP
If you set NHBUF to 0, the system configures
the number of buffer cache hash queues automatically at startup.
On a uniprocessor system, the system sets
the number of hash queues to the nearest power of 2 that is
greater than or equal to half the value of NBUF.
This should be treated as a recommended lower bound for
NHBUF; you may find that setting NHBUF
to a higher value gives better performance.
On a multiprocessor system, the system sets the number of hash queues to the nearest power of 2 that is greater than or equal to twice the value of NBUF. The reason for this can be seen from ``Keeping the ratio of hash queues to buffers low reduces contention for SMP''. On a system with an SCO SMP License, the kernel running on one CPU locks the entire hash queue when it accesses a buffer. The kernel running on another CPU that wants to access the same hash queue must wait until it is released. Such contention can be avoided by keeping the ratio of hash queues to buffers low. For example, if the value of NBUF is 32000 on a system with an SCO SMP License, you should set NHBUF to at least 65536.