1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00
freebsd/sys/amd64
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
..
amd64 Replace the mbuf external reference counting code with something 2000-08-19 08:32:59 +00:00
conf Revert previous commit. Not all RAID controllers are SCSI. 2000-07-29 02:12:44 +00:00
include Increase the default NAPIC from 1 to 2 as a bandaid until we allocate 2000-08-18 20:09:15 +00:00
isa Change the behavior of isa_nmi to log an error message instead of 2000-08-06 14:17:21 +00:00
pci Add PnP probe methods to some common AT hardware drivers. In each case, 2000-06-23 07:44:33 +00:00
Makefile Update tags directive to reflect the new location of soft updates 2000-07-04 00:18:43 +00:00