freebsd-skq/usr.bin
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
..
apply fork() -> vfork() 2000-05-19 09:42:53 +00:00
ar $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
at Y2K fix. at(1) would die with 'garbled time' when assign_date() was 2000-03-27 09:32:23 +00:00
banner Add -d and -t flags to usage. Add usage(). 2000-03-26 14:30:51 +00:00
basename Add DIAGNOSTICS section name 2000-03-26 14:42:14 +00:00
biff Don't call err() with no format string. 2000-07-10 08:42:58 +00:00
brandelf fix fd leak by close(fd) at end of loop. 2000-07-02 03:34:08 +00:00
c89 Typo. Standard list of flag 1999-12-05 20:01:28 +00:00
calendar These files are located under usr.bin/calendar/calendars/ru_RU.KOI8-R now 2000-05-04 11:40:15 +00:00
cap_mkdb Make better use of .Ar. Use DIAGNOSTICS instead of incorrect section name. 1999-11-21 16:16:30 +00:00
chat Remove more single-space hard sentence breaks. 2000-03-02 14:54:02 +00:00
checknr $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
chflags Switch over to using the new fflagstostr and strtofflags library calls. 2000-06-17 14:19:33 +00:00
chkey $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
chpass Use an MD5 checksum to test for file changes; the previous method 2000-04-12 08:49:14 +00:00
cksum Minimal use of .Ar and .Nm. 1999-12-05 20:03:22 +00:00
cmp Fix a bug introduced in rev 1.8, where special files ended up 2000-07-25 13:01:34 +00:00
col Use errx(). .Nm fixes 2000-03-26 14:23:23 +00:00
colcrt Start enumerate option with `The following options are available' like 2000-07-24 20:22:49 +00:00
colldef Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
colrm $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
column Add DIAGNOSTICS section name 2000-03-26 14:42:14 +00:00
comm fix the same typo as in uniq 1999-12-10 13:27:02 +00:00
compile_et Build this from contrib/ now. 1999-09-04 09:52:36 +00:00
compress From PR submitter: 2000-05-16 04:58:34 +00:00
ctags Style change and comment difference per bde. 2000-01-27 16:15:51 +00:00
cut Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
dig Use libbind to get to the extended resolver and headers. 1999-11-30 06:25:19 +00:00
dirname Tweaks to allow compiling -Wall (mostly adding "const" to char rcsid[]). 1998-12-06 22:58:23 +00:00
dnskeygen New program in the bind suite. I'm not sure that it's worth much while 1999-11-30 06:26:14 +00:00
dnsquery Use libbind to get to the extended resolver and headers. 1999-11-30 06:25:19 +00:00
doscmd Fix problems introduced in the previous commit: 2000-06-23 09:08:45 +00:00
du Fixed LDADD. Using ${LIBM} instead of -lm gave the wrong libm in most 2000-03-27 15:02:59 +00:00
ee Add current position (line, column) display. 2000-07-31 14:02:51 +00:00
enigma $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
env Add `-i'' option, which is the same as `-''. The -i option is the 1999-08-27 08:59:32 +00:00
expand Use errx(), remove unused #include. Correct SYNOPSIS 2000-03-26 14:28:31 +00:00
false $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
fetch Restore the old semantics of deleting the output file when interrupted. 2000-07-26 07:28:33 +00:00
file Add the RealMedia file format. Also, add the $FreeBSD$. 2000-07-03 04:59:37 +00:00
file2c Spelling (embedd to embed) fix and change a comma to a semicolon. 2000-07-11 22:52:12 +00:00
find Make passing unknown fstypes to -fstype result in a warning instead of 2000-07-28 20:02:42 +00:00
finger Remove extraneous arguments to the Os (operating system) and Nm 2000-08-17 16:57:31 +00:00
fmt Mark up the optional -c option with the Op macro. 2000-03-09 09:27:40 +00:00
fold $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
from $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
fstat Add a new options: -m enables searching for memory-mapped files. 2000-04-05 05:45:40 +00:00
fsync Avoid the need to capitalize an extraneous argument to the Nm macro 2000-07-24 21:53:04 +00:00
ftp "ls" is note the same as "nlist", but it is the same as "dir". Correct 2000-07-12 19:00:50 +00:00
gcore Change our ELF binary branding to something more acceptable to the Binutils 2000-04-18 02:39:26 +00:00
genassym The FreeBSD/Sparc64 port will also have an __ELF_WORD_SIZE of 64. 2000-04-02 20:22:04 +00:00
gencat Fix octal numbers parsing 2000-07-15 17:17:33 +00:00
gensetdefs The FreeBSD/Sparc64 port will also have an __ELF_WORD_SIZE of 64. 2000-04-02 20:22:04 +00:00
getconf Unbreak for the case where ``make obj'' was run first. 2000-04-26 07:00:46 +00:00
getopt Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
global $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
gprof Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
gprof4 Make profiling work for ELF. gprof now autodetects the format of 1998-09-07 23:32:00 +00:00
head $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
hexdump Oops, missed another printf() invocation with no format string. 2000-07-10 09:07:04 +00:00
host Use libbind to get to the extended resolver and headers. 1999-11-30 06:25:19 +00:00
id DIAGNOSTICS section name missing and .Nm changes 2000-03-26 14:24:40 +00:00
indent Don't call err() with no format string. 2000-07-10 09:14:15 +00:00
ipcrm Fix miscellaneous mdoc macro argument limit infringements. 2000-05-09 14:02:06 +00:00
ipcs Remove the undocumented semconfig() system calls. These cause more trouble 2000-05-01 10:49:41 +00:00
join Quote with .Dq 2000-03-27 20:33:32 +00:00
jot Don't call printf with no format string. 2000-07-10 06:02:13 +00:00
kdump Unbreak world build by adding the necessary <net/ethernet.h> include. 2000-08-02 07:37:44 +00:00
kenv Initial kenv(1) hack for dumping the kernel environment. This can be 2000-07-08 08:33:40 +00:00
key $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
keyinfo Fixed world breakage for the NOSHARED=yes case. Libraries were added to 2000-08-12 20:54:47 +00:00
keyinit Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
keylogin Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
keylogout $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
killall $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ktrace Don't call err() with no format string. 2000-07-10 09:14:15 +00:00
kzip Don't call err() with no format string. 2000-07-10 09:14:15 +00:00
lam Don't call err() with no format string. 2000-07-10 09:14:15 +00:00
last Don't call printf with no format string. 2000-07-10 06:02:13 +00:00
lastcomm $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ldd Corractly use .Nm and .An/.Aq macros. Replace FreeBSD with .Fx macro 2000-05-10 15:46:27 +00:00
leave Get rid of hard sentence break 2000-03-27 20:38:21 +00:00
less ncurses -> termcap 2000-07-14 16:17:42 +00:00
lessecho Fixed some style bugs. Apart from formatting bugs, MANDEPEND is deprecated 2000-06-03 11:39:38 +00:00
lesskey Fixed some style bugs. Apart from formatting bugs, MANDEPEND is deprecated 2000-06-03 11:39:38 +00:00
lex Install Flexlexer.h with mode 444. 1999-12-17 07:49:03 +00:00
limits Properly use .Nm, .Em, .Pa etc. Make usage() a simplier function. 2000-03-26 14:37:47 +00:00
locate /etc/weekly --> /etc/periodic/weekly/310.locate 2000-06-14 17:41:31 +00:00
lock Revert the libcrypt/libmd stuff back to how it was. This should not have 1999-12-18 13:55:17 +00:00
lockf $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
logger Allow logger to send messages directly to a remote syslog. (This 2000-07-18 08:56:54 +00:00
login Add braces to avoid ambiguity in a nested conditional (silences a gcc 2000-04-26 10:38:19 +00:00
logname Add DIAGNOSTICS section name 2000-03-26 14:42:14 +00:00
look $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
lorder Use different filenames. 2000-05-17 22:46:47 +00:00
lsvfs .Nm changes 2000-03-26 14:41:07 +00:00
m4 Remove unnecessary extern definition of strrchr. It is defined in 2000-08-16 16:39:42 +00:00
mail Complete migration of aliases file to /etc/mail/aliases. 2000-08-13 18:38:58 +00:00
make Remove gratuitous free() call when we use special .SHELL target. 2000-08-18 10:41:37 +00:00
makewhatis $Id$ -> $FreeBSD$ 1999-08-27 23:37:10 +00:00
mesg $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
minigzip $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
mk_cmds Small typo fix. 1999-12-20 09:35:12 +00:00
mkdep Capitalization errors: 1999-09-25 21:47:27 +00:00
mkfifo Add DIAGNOSTICS section name 2000-03-26 14:42:14 +00:00
mklocale There is a problem in that one cannot use ctype.h at the same time as parts 2000-02-08 07:43:26 +00:00
mkstr Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
mktemp Fix example. 2000-06-04 09:11:22 +00:00
msgs Complete migration of aliases file to /etc/mail/aliases. 2000-08-13 18:38:58 +00:00
mt Add cross reference to the ast device. 2000-08-16 16:38:47 +00:00
ncal Use %EF instead of hardcoded order for each country 1999-11-30 20:08:50 +00:00
ncplist Clear the Os macro and provide an HISTORY section instead. 2000-03-23 12:05:10 +00:00
ncplogin Fix a mistakenly broken sentence. The mistake was made easy by the 2000-03-27 10:50:54 +00:00
netstat Replace the mbuf external reference counting code with something 2000-08-19 08:32:59 +00:00
newkey $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
nfsstat Rev 1.9 did not follow style(9) in ordering. 1999-12-16 09:49:54 +00:00
nice Correct some hard sentence breaks. Only those surrounding the previous 1999-09-14 11:46:04 +00:00
nm Restore this file. 2000-05-02 21:53:52 +00:00
nohup Sync SYNOPSIS and usage() string. 2000-03-26 14:46:41 +00:00
objformat Since we build and install gasp(1) in /usr/libexec/${OBJFORMAT}/, 1999-12-24 15:18:19 +00:00
opieinfo $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
opiekey Fix minor style nits. 2000-05-14 21:13:57 +00:00
opiepasswd $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
pagesize $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
passwd Buildworld fixes for NO_OPENSSH and NO_OPENSSL 2000-03-09 06:29:05 +00:00
paste Put flags under .Fl. Add DIAGNOSTICS section name 2000-03-26 14:47:43 +00:00
pr Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
printenv The printenv(1) command is now a builtin(1) in csh(1). 2000-05-09 15:02:03 +00:00
printf Revert to 1.8. I misread the sentence and its context. 2000-07-21 20:18:50 +00:00
quota Remove incorrect use of .Nm. Wrap long lines, Unwrap short lines 2000-03-26 14:48:46 +00:00
ranlib $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
rdist Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
renice #include <errno.h> where needed. Kill extern int errno;. 2000-04-14 06:39:19 +00:00
rev $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
rlogin Buildworld fixes for NO_OPENSSH and NO_OPENSSL 2000-03-09 06:29:05 +00:00
rpcgen Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
rpcinfo $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
rs $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
rsh Fix a bug in rsh that caused the remote process to hang waiting on 2000-04-01 00:14:50 +00:00
rup Use .Pa 2000-03-26 14:49:49 +00:00
ruptime Do not dot terminate err() string. Cross reference using .Xr 2000-03-26 14:50:56 +00:00
rusers More rusers to .Nm convertion 2000-03-27 20:36:55 +00:00
rwall Put argument under .Ar. 2000-03-26 14:53:00 +00:00
rwho Get rid of hard sentence break 2000-03-27 20:38:21 +00:00
sasc remove unknown OPTIONS section name. Getopt returns -1. 2000-03-26 14:55:05 +00:00
script Don't call warn() with no format string. 2000-07-10 09:18:19 +00:00
sed Small style fix '=' -> ' = ' 2000-05-11 20:15:16 +00:00
shar $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
showmount Cross-reference mount_nfs(8) and showmount(8). 2000-07-18 17:34:23 +00:00
size $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
sockstat Do not dot terminate list of references 2000-03-26 14:56:52 +00:00
soelim Don't call warn() with no format string. 2000-07-10 09:18:19 +00:00
split $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
strings $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
strip $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
su Document the ``-'' option and minor re-wording in EXAMPLES 2000-08-05 23:03:12 +00:00
symorder $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
systat Fix systat to use the kern.ipc.mbtypes sysctl instead of referencing a 2000-07-15 16:24:21 +00:00
tail Convert calls to match new kqueue API. 2000-07-18 19:38:38 +00:00
talk Fix a bug when talking to non-freebsd machines where carriage return 2000-07-11 01:31:39 +00:00
tconv $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
tcopy Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
tee Add DIAGNOSTICS section name 2000-03-26 15:06:46 +00:00
telnet Fix buffer size of ALIGNed buffer. 2000-07-20 14:54:04 +00:00
tftp $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
time Correct some hard sentence breaks. Only those surrounding the previous 1999-09-14 11:46:04 +00:00
tip #include <errno.h> where needed. Kill extern int errno;. 2000-04-14 06:39:19 +00:00
top Reduce max length of user names to 15 characters to reflect reality. 1999-11-17 16:31:51 +00:00
touch Add DIAGNOSTICS section name 2000-03-26 15:06:46 +00:00
tput $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
tr Add DIAGNOSTICS section name 2000-03-26 15:06:46 +00:00
true Add $FreeBSD$ (and test remote commits after the Freefall upgrade) 2000-05-06 01:38:24 +00:00
truncate Merge the truncate(1) utility onto the RELENG_4 branch and adjust 2000-08-04 08:05:52 +00:00
truss Make auto-generated ioctl.c to be always considered out of date 2000-08-01 10:21:13 +00:00
tset Take a shot at making this work under termcap/terminfo ncurses. It 1999-08-30 08:27:31 +00:00
tsort $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
tty $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
uac Fix typo(s) I overlooked in my last commit. 2000-06-20 15:40:50 +00:00
ul Don't coredump on long input lines. If anyone actually cares, this should 2000-07-31 10:14:06 +00:00
uname $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
unexpand $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
unifdef $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
uniq Add DIAGNOSTICS section name 2000-03-26 15:06:46 +00:00
units Don't segv when trying to add a 0-length unit name. 2000-07-31 10:49:08 +00:00
unvis $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
usbhidctl Rename the `name'' argument to `item'' and mark it up as an argument. 2000-07-20 11:39:14 +00:00
users $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
uudecode While I'm in here, remove an unused variable. 2000-03-30 09:23:28 +00:00
uuencode Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
vacation Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
vgrind $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
vi Do not pull in <sys/select.h>, it isn't required. 2000-04-16 17:34:33 +00:00
vis $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
vmstat Remove unneeded #include <sys/buf.h> 2000-05-05 16:07:10 +00:00
w Use the same technique as ps(1) to avoid the need for setgid. (ie: use 1999-11-17 15:28:45 +00:00
wall Let wall report the local timezone as well on output. 2000-07-27 07:58:47 +00:00
wc Add DIAGNOSTICS section name 2000-03-26 15:06:46 +00:00
what Add usage(). 2000-03-26 15:04:35 +00:00
whereis $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
which Add a missing .El macro. 2000-01-14 10:47:54 +00:00
who $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
whois Enable whois queries over IPv6 2000-07-07 07:52:21 +00:00
window #include <errno.h> where needed. Kill extern int errno;. 2000-04-14 06:39:19 +00:00
write $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
xargs Use .Xr 2000-03-26 15:05:40 +00:00
xinstall Switch over to using the new fflagstostr and strtofflags library calls. 2000-06-17 14:19:33 +00:00
xlint Remove single-space hard sentence breaks. These degrade the quality 2000-03-01 12:20:22 +00:00
xstr $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
yacc Fixed breakage of K&R support in rev.1.26. yyparse() was defined as 2000-01-17 02:04:06 +00:00
yes Correct the attribution for yes(1). 2000-07-18 18:32:08 +00:00
ypcat $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ypmatch $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ypwhich $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Makefile Add fsync(8). This becomes useful with the advent of MAP_NOSYNC etc. 2000-07-19 08:38:18 +00:00
Makefile.inc