freebsd-nq/sys/alpha
David Malone a5c4836d39 Replace the mbuf external reference counting code with something
that should be better.

The old code counted references to mbuf clusters by using the offset
of the cluster from the start of memory allocated for mbufs and
clusters as an index into an array of chars, which did the reference
counting. If the external storage was not a cluster then reference
counting had to be done by the code using that external storage.

NetBSD's system of linked lists of mbufs was cosidered, but Alfred
felt it would have locking issues when the kernel was made more
SMP friendly.

The system implimented uses a pool of unions to track external
storage. The union contains an int for counting the references and
a pointer for forming a free list. The reference counts are
incremented and decremented atomically and so should be SMP friendly.
This system can track reference counts for any sort of external
storage.

Access to the reference counting stuff is now through macros defined
in mbuf.h, so it should be easier to make changes to the system in
the future.

The possibility of storing the reference count in one of the
referencing mbufs was considered, but was rejected 'cos it would
often leave extra mbufs allocated. Storing the reference count in
the cluster was also considered, but because the external storage
may not be a cluster this isn't an option.

The size of the pool of reference counters is available in the
stats provided by "netstat -m".

PR:		19866
Submitted by:	Bosko Milekic <bmilekic@dsuper.net>
Reviewed by:	alfred (glanced at by others on -net)
2000-08-19 08:32:59 +00:00
..
alpha Replace the mbuf external reference counting code with something 2000-08-19 08:32:59 +00:00
conf Move RAID controllers to the same position as in i386 GENERIC. 2000-07-29 02:13:42 +00:00
include Remove offensive language. 2000-06-25 09:30:53 +00:00
isa remove breakage that snuck in with my last commit 2000-06-29 02:26:48 +00:00
linux Sigh. Fix SYS_exit problems. I misunderstood the significance of these 2000-07-29 10:05:25 +00:00
mcbus Handle (for now) trivial one level bridge case so we can get the 2000-07-13 03:45:11 +00:00
osf1 Regen. (Fix SYS_exit) 2000-07-29 10:07:38 +00:00
pci Do the same thing for TurboLaser that was done for Rawhide- make room 2000-07-10 02:40:49 +00:00
tc Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
tlsb Do the same thing for TurboLaser that was done for Rawhide- make room 2000-07-10 02:40:49 +00:00