freebsd-src/sys
Kirk McKusick e929c00d23 The buffer queue mechanism has been reformulated. Instead of having
QUEUE_AGE, QUEUE_LRU, and QUEUE_EMPTY we instead have QUEUE_CLEAN,
QUEUE_DIRTY, QUEUE_EMPTY, and QUEUE_EMPTYKVA.  With this patch clean
and dirty buffers have been separated.  Empty buffers with KVM
assignments have been separated from truely empty buffers.  getnewbuf()
has been rewritten and now operates in a 100% optimal fashion.  That is,
it is able to find precisely the right kind of buffer it needs to
allocate a new buffer, defragment KVM, or to free-up an existing buffer
when the buffer cache is full (which is a steady-state situation for
the buffer cache).

Buffer flushing has been reorganized.  Previously buffers were flushed
in the context of whatever process hit the conditions forcing buffer
flushing to occur.  This resulted in processes blocking on conditions
unrelated to what they were doing.  This also resulted in inappropriate
VFS stacking chains due to multiple processes getting stuck trying to
flush dirty buffers or due to a single process getting into a situation
where it might attempt to flush buffers recursively - a situation that
was only partially fixed in prior commits.  We have added a new daemon
called the buf_daemon which is responsible for flushing dirty buffers
when the number of dirty buffers exceeds the vfs.hidirtybuffers limit.
This daemon attempts to dynamically adjust the rate at which dirty buffers
are flushed such that getnewbuf() calls (almost) never block.

The number of nbufs and amount of buffer space is now scaled past the
8MB limit that was previously imposed for systems with over 64MB of
memory, and the vfs.{lo,hi}dirtybuffers limits have been relaxed
somewhat.  The number of physical buffers has been increased with the
intention that we will manage physical I/O differently in the future.

reassignbuf previously attempted to keep the dirtyblkhd list sorted which
could result in non-deterministic operation under certain conditions,
such as when a large number of dirty buffers are being managed.  This
algorithm has been changed.  reassignbuf now keeps buffers locally sorted
if it can do so cheaply, and otherwise gives up and adds buffers to
the head of the dirtyblkhd list.  The new algorithm is deterministic but
not perfect.  The new algorithm greatly reduces problems that previously
occured when write_behind was turned off in the system.

The P_FLSINPROG proc->p_flag bit has been replaced by the more descriptive
P_BUFEXHAUST bit.  This bit allows processes working with filesystem
buffers to use available emergency reserves.  Normal processes do not set
this bit and are not allowed to dig into emergency reserves.  The purpose
of this bit is to avoid low-memory deadlocks.

A small race condition was fixed in getpbuf() in vm/vm_pager.c.

Submitted by:	Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by:	Kirk McKusick <mckusick@mckusick.com>
1999-07-04 00:25:38 +00:00
..
alpha Improve compatibility with other systems by changing the default 1999-07-03 20:14:08 +00:00
amd64 The buffer queue mechanism has been reformulated. Instead of having 1999-07-04 00:25:38 +00:00
boot Document the hw.physmem tunable. (There should be arch-specific tunable 1999-07-02 20:38:05 +00:00
cam Make the change similar to that suggested by Nick Hibma to avoid divide by 1999-07-03 21:14:45 +00:00
coda Simplify cdevsw registration. 1999-05-31 11:29:30 +00:00
compat sys/buf.h needs to have included sys/systm.h for spl prototypes. 1999-07-03 04:56:57 +00:00
compile
conf Update comment for new location of soft-updates sources. 1999-07-03 21:31:00 +00:00
contrib No longer need to set B_ASYNC flag since BUF_KERNPROC now 1999-06-29 15:57:40 +00:00
ddb Quiet warnings on Alpha. (db_expr_t is a long on alpha, int on x86) 1999-07-01 19:42:56 +00:00
dev Add the semi-official Bulk protocol id 'P' 1999-07-03 22:19:41 +00:00
fs Make sure that stat(2) and friends always return a valid st_dev field. 1999-07-02 16:29:47 +00:00
geom Initialize and hold locks for ccd generated bufs.. 1999-06-27 09:28:43 +00:00
gnu Convert buffer locking from using the B_BUSY and B_WANTED flags to using 1999-06-26 02:47:16 +00:00
i4b devsw and cdevsw_add() changes for i4b. 1999-06-01 08:46:56 +00:00
i386 The buffer queue mechanism has been reformulated. Instead of having 1999-07-04 00:25:38 +00:00
isa Allocate the port resource when attaching the keyboard controller, 1999-06-29 17:35:09 +00:00
isofs/cd9660 Simplify cdevsw registration. 1999-05-31 11:29:30 +00:00
kern The buffer queue mechanism has been reformulated. Instead of having 1999-07-04 00:25:38 +00:00
libkern Add a fast version of bcmp which compares longwords at a time. 1999-06-19 16:30:28 +00:00
miscfs Make sure that stat(2) and friends always return a valid st_dev field. 1999-07-02 16:29:47 +00:00
modules Use the correct value for banksize so splash_pcx works in LFB modes. 1999-06-28 13:52:29 +00:00
msdosfs move <sys/systm.h> before <sys/buf.h> 1999-07-01 22:12:39 +00:00
net Fix a printf int/long problem on the Alpha 1999-07-01 22:14:51 +00:00
netatalk Change suser_xxx() to suser() where it applies. 1999-04-27 12:21:16 +00:00
netatm Allow configuration of up to 256 network interfaces per physical interface - 1999-05-10 23:02:29 +00:00
netinet In in_pcbconnect(), check the return value from in_pcbbind() and 1999-06-25 23:46:47 +00:00
netipx Suser() simplification: 1999-04-27 11:18:52 +00:00
netkey #ifdef out unused function key_freetables. 1999-01-12 12:38:31 +00:00
netnatm
netns
nfs Fix warning. va_fsid is udev_t, which is int32_t. No need to use %lx. 1999-07-01 13:32:54 +00:00
nfsclient Fix warning. va_fsid is udev_t, which is int32_t. No need to use %lx. 1999-07-01 13:32:54 +00:00
nfsserver Submitted by: "David E. Cross" <crossd@cs.rpi.edu> 1999-06-30 04:29:13 +00:00
ntfs Simplify cdevsw registration. 1999-05-31 11:29:30 +00:00
pc98 Added copyright. 1999-07-03 08:50:45 +00:00
pccard Eliminate a bunch of #include "pci.h" and #if NPCI > 0 around entire 1999-07-03 20:17:08 +00:00
pci Eliminate a bunch of #include "pci.h" and #if NPCI > 0 around entire 1999-07-03 20:17:08 +00:00
posix4 Well folks, this is it - The second stage of the removal for build support 1999-04-17 08:36:07 +00:00
powerpc Add alpha_platform_setup_ide_intr() and alpha_platform_assign_pciintr() 1999-07-01 22:47:53 +00:00
rpc
svr4 sys/buf.h needs to have included sys/systm.h for spl prototypes. 1999-07-03 04:56:57 +00:00
sys The buffer queue mechanism has been reformulated. Instead of having 1999-07-04 00:25:38 +00:00
tools Add a vnode argument to VOP_BWRITE to get rid of the last vnode 1999-06-16 23:27:55 +00:00
ufs Update pathnames for new location of soft-updates sources. 1999-07-03 21:34:05 +00:00
vm The buffer queue mechanism has been reformulated. Instead of having 1999-07-04 00:25:38 +00:00
Makefile Use MACHINE_ARCH instead of MACHINE to check x86 architecture. 1999-06-03 10:38:07 +00:00