History log of /openbsd-current/usr.bin/systat/mbufs.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.44 22-Dec-2020 dlg

print all the rings on a nic without limiting it to the number of mclpools

"makes sense" jmatthew@


Revision tags: OPENBSD_6_8_BASE
# 1.43 15-Jun-2020 dlg

print the name of the rings in systat mbuf output too.

useful if you're looking at a nic with a lot of different rings.


Revision tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.42 28-Jun-2019 deraadt

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.41 04-Apr-2016 sthen

Add sys/queue.h where it's needed. Unbreak userland following recent
removal from mbuf.h. ok mpi@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.40 18-Apr-2015 jsg

Avoid calling freeifaddrs() with an uninitialised pointer in an
error path.


Revision tags: OPENBSD_5_7_BASE
# 1.39 20-Jan-2015 deraadt

Adjust <sys/param.h> comments regarding use of use of MSIZE, or
delete <sys/param.h> if now possible
ok guenther


# 1.38 16-Jan-2015 deraadt

first batch of programs adapting to the namespace cleanup
(pfvar.h nameser.h proc.h ucred.h)
ok guenther millert, and some review from doug as well.


# 1.37 06-Nov-2014 dlg

i renamed the mbuf pool.


# 1.36 20-Oct-2014 jsg

fix if (statement);
ok dlg@


Revision tags: OPENBSD_5_6_BASE
# 1.35 08-Jul-2014 dlg

cut things that relied on mclgeti for rx ring accounting/restriction over
to using if_rxr.

cut the reporting systat did over to the rxr ioctl.

tested as much as i can on alpha, amd64, and sparc64.
mpi@ has run it on macppc.
ok mpi@


# 1.34 02-Jul-2014 dlg

info about pools is currently given to userland by copying each
pools struct out. however, struct pool in the kernel contains lots
of things that userland probably isnt interested in, like actual
mutexes, and probably shouldnt get easy access to, like pointers
to kernel memory via all the lists/trees.

this implements a kinfo_pool structure that has only the data that
userland needs to know about. it cuts the sysctl code over to
building it from struct pool as required and copying that out
instead, and cuts userland over to only handling kinfo_pool.

the only problem with this is vmstat, which can read kernel images
via kvm, which needs some understanding of struct pool. to cope,
the struct pool definition is guarded by if defined(_KERNEL) ||
defined(_LIBKVM) as inspired by sysctl which needs to do the same
thing sometimes. struct pool itself is generally not visible to
userland though, which is good.

matthew@ suggested struct kinfo_pool instead of struct pool_info.
the kinfo prefix has precedent.
lots of people liked this.


# 1.33 13-Jun-2014 mpi

Now that the water marks are updated on a per-pool basis indicate in
the LIVELOCKS column if there is a pending (deferred) update.

ok claudio@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.32 02-Mar-2011 jasper

- use a common FIELD_ADDR macro, instead of rolling 78 identical copies.

ok canacar@


Revision tags: OPENBSD_4_9_BASE
# 1.31 05-Nov-2010 claudio

Print relativ number of livelocks that happend between two systat
updates instead of showing absolut figures. Makes it easier to
estimate the "livelockyness" of a system.
OK dlg@


# 1.30 02-Nov-2010 dlg

expose the kernels network livelock counter


# 1.29 23-Sep-2010 dlg

tweak the mclgeti algorithm to behave better under load.

instead of letting hardware rings grow on every interrupt, restrict
it so it can only grow once per softclock tick. we can only punish
the rings on softclock ticks, so it make sense to only grow on
softclock tick boundaries too.

the rings are now punished after >1 lost softclock tick rather than
>2. mclgeti is now more aggressive at detecting livelock.

the rings get punished by an 8th, rather than by half.

we now allow the rings to be punished again even if the system is
already considered in livelock.

without this diff a livelocked system will have its rx ring sizes
scale up and down very rapidly, while holding the rings low for too
long. this affected throughput significantly.

discussed and tested heavily at j2k10. there are still some games
with softnet we can play, but this is a good first step.

"put it in" and ok deraadt@
ok claudio@ krw@ henning@ mcbride@

if we find out that it sucks we can pull it out again later. till then
we'll run with it and see how it goes.


Revision tags: OPENBSD_4_8_BASE
# 1.28 01-Aug-2010 blambert

don't rely on mbuf.h to pull in pool.h here either

ok miod@


# 1.27 01-Aug-2010 chl

fix use of uninitialized variable.

reported by gcc.

ok canacar@


Revision tags: OPENBSD_4_7_BASE
# 1.26 23-Nov-2009 henning

args, not that file


# 1.25 23-Nov-2009 henning

no more natpass


Revision tags: OPENBSD_4_6_BASE
# 1.24 20-Apr-2009 chl

remove unneeded argument to warnx()
remove unused variable
kill some extra blank lines

ok canacar@


# 1.23 29-Mar-2009 kettenis

Make sure systat mbufs prints the interface name even if an interface only
allocates clusters larger than 2k.

ok deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.22 27-Jan-2009 dlg

fix the mbuf view to cope with the recent change to the mclgeti allocator.

from canacar@


# 1.21 31-Dec-2008 canacar

Skip missing pool indices instead of printing errors.


# 1.20 18-Dec-2008 canacar

Print the interface livelocks if non-zero. From deraadt@


# 1.19 17-Dec-2008 canacar

Rewrite the 'mbuf' page to display mbuf usage information from system pools
and mbuf cluster statistics collected for each interface. More useful than
earlier bar graphs about mbuf types. Requested by and ok deraadt@


Revision tags: OPENBSD_4_4_BASE
# 1.18 12-Jun-2008 canacar

New display engine for systat, based on pftop. Adds new views for pf
(status, state, rule, queue). While all displays work, some keyboard
comands are not implemented yet. Other features include better handling
of display resize and scrolling for long views. Committing now to fix
the remaining issues in the tree.
Testing and comments by otto@ and harding@, ok deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 25-Feb-2007 deraadt

use the 1 line load line from 'systat vm' on all the other displays, giving
them more room. much cleaner, and it is less code too; ok deanna


Revision tags: OPENBSD_4_0_BASE
# 1.16 31-Mar-2006 deraadt

fairly simple cleanup, lots of testing done


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.15 09-Jul-2004 deraadt

post-mortem stuff can go away here too


# 1.14 03-Jul-2004 deraadt

move sysctl comment on namelist[] entry


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.13 03-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.12 19-Jun-2002 deraadt

mark which nlist[] kmem entries are not needed in the sysctl case, and which are


# 1.11 18-Jun-2002 deraadt

ANSI


# 1.10 09-Jun-2002 angelos

Use sysctl for mbstat


Revision tags: OPENBSD_3_1_BASE
# 1.9 07-Dec-2001 deraadt

move back. pvalchev -- the bug was quite obscure


# 1.8 07-Dec-2001 pvalchev

back out latest changes which cause problems on alpha/sparc64 until
they are fixed


# 1.7 23-Nov-2001 deraadt

fix signal races. use sysctl() instead of kvm where possible, and then KNF
the hell out of it; checked by miod


# 1.6 19-Nov-2001 mpech

kill more registers

millert@ ok


Revision tags: OPENBSD_3_0_BASE
# 1.5 04-May-2001 ericj

handle kvm_nlist() failing, from pr#1798.
Patch similar to the one submitted by <peterw@documenta.com.au>


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.4 19-Dec-1997 deraadt

bye bye sprintf


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE
# 1.3 26-Jun-1996 deraadt

rcsid


# 1.2 02-Jun-1996 mickey

it compiles w/ new curses


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.43 15-Jun-2020 dlg

print the name of the rings in systat mbuf output too.

useful if you're looking at a nic with a lot of different rings.


Revision tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.42 28-Jun-2019 deraadt

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.41 04-Apr-2016 sthen

Add sys/queue.h where it's needed. Unbreak userland following recent
removal from mbuf.h. ok mpi@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.40 18-Apr-2015 jsg

Avoid calling freeifaddrs() with an uninitialised pointer in an
error path.


Revision tags: OPENBSD_5_7_BASE
# 1.39 20-Jan-2015 deraadt

Adjust <sys/param.h> comments regarding use of use of MSIZE, or
delete <sys/param.h> if now possible
ok guenther


# 1.38 16-Jan-2015 deraadt

first batch of programs adapting to the namespace cleanup
(pfvar.h nameser.h proc.h ucred.h)
ok guenther millert, and some review from doug as well.


# 1.37 06-Nov-2014 dlg

i renamed the mbuf pool.


# 1.36 20-Oct-2014 jsg

fix if (statement);
ok dlg@


Revision tags: OPENBSD_5_6_BASE
# 1.35 08-Jul-2014 dlg

cut things that relied on mclgeti for rx ring accounting/restriction over
to using if_rxr.

cut the reporting systat did over to the rxr ioctl.

tested as much as i can on alpha, amd64, and sparc64.
mpi@ has run it on macppc.
ok mpi@


# 1.34 02-Jul-2014 dlg

info about pools is currently given to userland by copying each
pools struct out. however, struct pool in the kernel contains lots
of things that userland probably isnt interested in, like actual
mutexes, and probably shouldnt get easy access to, like pointers
to kernel memory via all the lists/trees.

this implements a kinfo_pool structure that has only the data that
userland needs to know about. it cuts the sysctl code over to
building it from struct pool as required and copying that out
instead, and cuts userland over to only handling kinfo_pool.

the only problem with this is vmstat, which can read kernel images
via kvm, which needs some understanding of struct pool. to cope,
the struct pool definition is guarded by if defined(_KERNEL) ||
defined(_LIBKVM) as inspired by sysctl which needs to do the same
thing sometimes. struct pool itself is generally not visible to
userland though, which is good.

matthew@ suggested struct kinfo_pool instead of struct pool_info.
the kinfo prefix has precedent.
lots of people liked this.


# 1.33 13-Jun-2014 mpi

Now that the water marks are updated on a per-pool basis indicate in
the LIVELOCKS column if there is a pending (deferred) update.

ok claudio@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.32 02-Mar-2011 jasper

- use a common FIELD_ADDR macro, instead of rolling 78 identical copies.

ok canacar@


Revision tags: OPENBSD_4_9_BASE
# 1.31 05-Nov-2010 claudio

Print relativ number of livelocks that happend between two systat
updates instead of showing absolut figures. Makes it easier to
estimate the "livelockyness" of a system.
OK dlg@


# 1.30 02-Nov-2010 dlg

expose the kernels network livelock counter


# 1.29 23-Sep-2010 dlg

tweak the mclgeti algorithm to behave better under load.

instead of letting hardware rings grow on every interrupt, restrict
it so it can only grow once per softclock tick. we can only punish
the rings on softclock ticks, so it make sense to only grow on
softclock tick boundaries too.

the rings are now punished after >1 lost softclock tick rather than
>2. mclgeti is now more aggressive at detecting livelock.

the rings get punished by an 8th, rather than by half.

we now allow the rings to be punished again even if the system is
already considered in livelock.

without this diff a livelocked system will have its rx ring sizes
scale up and down very rapidly, while holding the rings low for too
long. this affected throughput significantly.

discussed and tested heavily at j2k10. there are still some games
with softnet we can play, but this is a good first step.

"put it in" and ok deraadt@
ok claudio@ krw@ henning@ mcbride@

if we find out that it sucks we can pull it out again later. till then
we'll run with it and see how it goes.


Revision tags: OPENBSD_4_8_BASE
# 1.28 01-Aug-2010 blambert

don't rely on mbuf.h to pull in pool.h here either

ok miod@


# 1.27 01-Aug-2010 chl

fix use of uninitialized variable.

reported by gcc.

ok canacar@


Revision tags: OPENBSD_4_7_BASE
# 1.26 23-Nov-2009 henning

args, not that file


# 1.25 23-Nov-2009 henning

no more natpass


Revision tags: OPENBSD_4_6_BASE
# 1.24 20-Apr-2009 chl

remove unneeded argument to warnx()
remove unused variable
kill some extra blank lines

ok canacar@


# 1.23 29-Mar-2009 kettenis

Make sure systat mbufs prints the interface name even if an interface only
allocates clusters larger than 2k.

ok deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.22 27-Jan-2009 dlg

fix the mbuf view to cope with the recent change to the mclgeti allocator.

from canacar@


# 1.21 31-Dec-2008 canacar

Skip missing pool indices instead of printing errors.


# 1.20 18-Dec-2008 canacar

Print the interface livelocks if non-zero. From deraadt@


# 1.19 17-Dec-2008 canacar

Rewrite the 'mbuf' page to display mbuf usage information from system pools
and mbuf cluster statistics collected for each interface. More useful than
earlier bar graphs about mbuf types. Requested by and ok deraadt@


Revision tags: OPENBSD_4_4_BASE
# 1.18 12-Jun-2008 canacar

New display engine for systat, based on pftop. Adds new views for pf
(status, state, rule, queue). While all displays work, some keyboard
comands are not implemented yet. Other features include better handling
of display resize and scrolling for long views. Committing now to fix
the remaining issues in the tree.
Testing and comments by otto@ and harding@, ok deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 25-Feb-2007 deraadt

use the 1 line load line from 'systat vm' on all the other displays, giving
them more room. much cleaner, and it is less code too; ok deanna


Revision tags: OPENBSD_4_0_BASE
# 1.16 31-Mar-2006 deraadt

fairly simple cleanup, lots of testing done


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.15 09-Jul-2004 deraadt

post-mortem stuff can go away here too


# 1.14 03-Jul-2004 deraadt

move sysctl comment on namelist[] entry


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.13 03-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.12 19-Jun-2002 deraadt

mark which nlist[] kmem entries are not needed in the sysctl case, and which are


# 1.11 18-Jun-2002 deraadt

ANSI


# 1.10 09-Jun-2002 angelos

Use sysctl for mbstat


Revision tags: OPENBSD_3_1_BASE
# 1.9 07-Dec-2001 deraadt

move back. pvalchev -- the bug was quite obscure


# 1.8 07-Dec-2001 pvalchev

back out latest changes which cause problems on alpha/sparc64 until
they are fixed


# 1.7 23-Nov-2001 deraadt

fix signal races. use sysctl() instead of kvm where possible, and then KNF
the hell out of it; checked by miod


# 1.6 19-Nov-2001 mpech

kill more registers

millert@ ok


Revision tags: OPENBSD_3_0_BASE
# 1.5 04-May-2001 ericj

handle kvm_nlist() failing, from pr#1798.
Patch similar to the one submitted by <peterw@documenta.com.au>


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.4 19-Dec-1997 deraadt

bye bye sprintf


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE
# 1.3 26-Jun-1996 deraadt

rcsid


# 1.2 02-Jun-1996 mickey

it compiles w/ new curses


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.42 28-Jun-2019 deraadt

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.41 04-Apr-2016 sthen

Add sys/queue.h where it's needed. Unbreak userland following recent
removal from mbuf.h. ok mpi@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.40 18-Apr-2015 jsg

Avoid calling freeifaddrs() with an uninitialised pointer in an
error path.


Revision tags: OPENBSD_5_7_BASE
# 1.39 20-Jan-2015 deraadt

Adjust <sys/param.h> comments regarding use of use of MSIZE, or
delete <sys/param.h> if now possible
ok guenther


# 1.38 16-Jan-2015 deraadt

first batch of programs adapting to the namespace cleanup
(pfvar.h nameser.h proc.h ucred.h)
ok guenther millert, and some review from doug as well.


# 1.37 06-Nov-2014 dlg

i renamed the mbuf pool.


# 1.36 20-Oct-2014 jsg

fix if (statement);
ok dlg@


Revision tags: OPENBSD_5_6_BASE
# 1.35 08-Jul-2014 dlg

cut things that relied on mclgeti for rx ring accounting/restriction over
to using if_rxr.

cut the reporting systat did over to the rxr ioctl.

tested as much as i can on alpha, amd64, and sparc64.
mpi@ has run it on macppc.
ok mpi@


# 1.34 02-Jul-2014 dlg

info about pools is currently given to userland by copying each
pools struct out. however, struct pool in the kernel contains lots
of things that userland probably isnt interested in, like actual
mutexes, and probably shouldnt get easy access to, like pointers
to kernel memory via all the lists/trees.

this implements a kinfo_pool structure that has only the data that
userland needs to know about. it cuts the sysctl code over to
building it from struct pool as required and copying that out
instead, and cuts userland over to only handling kinfo_pool.

the only problem with this is vmstat, which can read kernel images
via kvm, which needs some understanding of struct pool. to cope,
the struct pool definition is guarded by if defined(_KERNEL) ||
defined(_LIBKVM) as inspired by sysctl which needs to do the same
thing sometimes. struct pool itself is generally not visible to
userland though, which is good.

matthew@ suggested struct kinfo_pool instead of struct pool_info.
the kinfo prefix has precedent.
lots of people liked this.


# 1.33 13-Jun-2014 mpi

Now that the water marks are updated on a per-pool basis indicate in
the LIVELOCKS column if there is a pending (deferred) update.

ok claudio@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.32 02-Mar-2011 jasper

- use a common FIELD_ADDR macro, instead of rolling 78 identical copies.

ok canacar@


Revision tags: OPENBSD_4_9_BASE
# 1.31 05-Nov-2010 claudio

Print relativ number of livelocks that happend between two systat
updates instead of showing absolut figures. Makes it easier to
estimate the "livelockyness" of a system.
OK dlg@


# 1.30 02-Nov-2010 dlg

expose the kernels network livelock counter


# 1.29 23-Sep-2010 dlg

tweak the mclgeti algorithm to behave better under load.

instead of letting hardware rings grow on every interrupt, restrict
it so it can only grow once per softclock tick. we can only punish
the rings on softclock ticks, so it make sense to only grow on
softclock tick boundaries too.

the rings are now punished after >1 lost softclock tick rather than
>2. mclgeti is now more aggressive at detecting livelock.

the rings get punished by an 8th, rather than by half.

we now allow the rings to be punished again even if the system is
already considered in livelock.

without this diff a livelocked system will have its rx ring sizes
scale up and down very rapidly, while holding the rings low for too
long. this affected throughput significantly.

discussed and tested heavily at j2k10. there are still some games
with softnet we can play, but this is a good first step.

"put it in" and ok deraadt@
ok claudio@ krw@ henning@ mcbride@

if we find out that it sucks we can pull it out again later. till then
we'll run with it and see how it goes.


Revision tags: OPENBSD_4_8_BASE
# 1.28 01-Aug-2010 blambert

don't rely on mbuf.h to pull in pool.h here either

ok miod@


# 1.27 01-Aug-2010 chl

fix use of uninitialized variable.

reported by gcc.

ok canacar@


Revision tags: OPENBSD_4_7_BASE
# 1.26 23-Nov-2009 henning

args, not that file


# 1.25 23-Nov-2009 henning

no more natpass


Revision tags: OPENBSD_4_6_BASE
# 1.24 20-Apr-2009 chl

remove unneeded argument to warnx()
remove unused variable
kill some extra blank lines

ok canacar@


# 1.23 29-Mar-2009 kettenis

Make sure systat mbufs prints the interface name even if an interface only
allocates clusters larger than 2k.

ok deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.22 27-Jan-2009 dlg

fix the mbuf view to cope with the recent change to the mclgeti allocator.

from canacar@


# 1.21 31-Dec-2008 canacar

Skip missing pool indices instead of printing errors.


# 1.20 18-Dec-2008 canacar

Print the interface livelocks if non-zero. From deraadt@


# 1.19 17-Dec-2008 canacar

Rewrite the 'mbuf' page to display mbuf usage information from system pools
and mbuf cluster statistics collected for each interface. More useful than
earlier bar graphs about mbuf types. Requested by and ok deraadt@


Revision tags: OPENBSD_4_4_BASE
# 1.18 12-Jun-2008 canacar

New display engine for systat, based on pftop. Adds new views for pf
(status, state, rule, queue). While all displays work, some keyboard
comands are not implemented yet. Other features include better handling
of display resize and scrolling for long views. Committing now to fix
the remaining issues in the tree.
Testing and comments by otto@ and harding@, ok deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 25-Feb-2007 deraadt

use the 1 line load line from 'systat vm' on all the other displays, giving
them more room. much cleaner, and it is less code too; ok deanna


Revision tags: OPENBSD_4_0_BASE
# 1.16 31-Mar-2006 deraadt

fairly simple cleanup, lots of testing done


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.15 09-Jul-2004 deraadt

post-mortem stuff can go away here too


# 1.14 03-Jul-2004 deraadt

move sysctl comment on namelist[] entry


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.13 03-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.12 19-Jun-2002 deraadt

mark which nlist[] kmem entries are not needed in the sysctl case, and which are


# 1.11 18-Jun-2002 deraadt

ANSI


# 1.10 09-Jun-2002 angelos

Use sysctl for mbstat


Revision tags: OPENBSD_3_1_BASE
# 1.9 07-Dec-2001 deraadt

move back. pvalchev -- the bug was quite obscure


# 1.8 07-Dec-2001 pvalchev

back out latest changes which cause problems on alpha/sparc64 until
they are fixed


# 1.7 23-Nov-2001 deraadt

fix signal races. use sysctl() instead of kvm where possible, and then KNF
the hell out of it; checked by miod


# 1.6 19-Nov-2001 mpech

kill more registers

millert@ ok


Revision tags: OPENBSD_3_0_BASE
# 1.5 04-May-2001 ericj

handle kvm_nlist() failing, from pr#1798.
Patch similar to the one submitted by <peterw@documenta.com.au>


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.4 19-Dec-1997 deraadt

bye bye sprintf


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE
# 1.3 26-Jun-1996 deraadt

rcsid


# 1.2 02-Jun-1996 mickey

it compiles w/ new curses


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.41 04-Apr-2016 sthen

Add sys/queue.h where it's needed. Unbreak userland following recent
removal from mbuf.h. ok mpi@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.40 18-Apr-2015 jsg

Avoid calling freeifaddrs() with an uninitialised pointer in an
error path.


Revision tags: OPENBSD_5_7_BASE
# 1.39 20-Jan-2015 deraadt

Adjust <sys/param.h> comments regarding use of use of MSIZE, or
delete <sys/param.h> if now possible
ok guenther


# 1.38 16-Jan-2015 deraadt

first batch of programs adapting to the namespace cleanup
(pfvar.h nameser.h proc.h ucred.h)
ok guenther millert, and some review from doug as well.


# 1.37 06-Nov-2014 dlg

i renamed the mbuf pool.


# 1.36 20-Oct-2014 jsg

fix if (statement);
ok dlg@


Revision tags: OPENBSD_5_6_BASE
# 1.35 08-Jul-2014 dlg

cut things that relied on mclgeti for rx ring accounting/restriction over
to using if_rxr.

cut the reporting systat did over to the rxr ioctl.

tested as much as i can on alpha, amd64, and sparc64.
mpi@ has run it on macppc.
ok mpi@


# 1.34 02-Jul-2014 dlg

info about pools is currently given to userland by copying each
pools struct out. however, struct pool in the kernel contains lots
of things that userland probably isnt interested in, like actual
mutexes, and probably shouldnt get easy access to, like pointers
to kernel memory via all the lists/trees.

this implements a kinfo_pool structure that has only the data that
userland needs to know about. it cuts the sysctl code over to
building it from struct pool as required and copying that out
instead, and cuts userland over to only handling kinfo_pool.

the only problem with this is vmstat, which can read kernel images
via kvm, which needs some understanding of struct pool. to cope,
the struct pool definition is guarded by if defined(_KERNEL) ||
defined(_LIBKVM) as inspired by sysctl which needs to do the same
thing sometimes. struct pool itself is generally not visible to
userland though, which is good.

matthew@ suggested struct kinfo_pool instead of struct pool_info.
the kinfo prefix has precedent.
lots of people liked this.


# 1.33 13-Jun-2014 mpi

Now that the water marks are updated on a per-pool basis indicate in
the LIVELOCKS column if there is a pending (deferred) update.

ok claudio@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.32 02-Mar-2011 jasper

- use a common FIELD_ADDR macro, instead of rolling 78 identical copies.

ok canacar@


Revision tags: OPENBSD_4_9_BASE
# 1.31 05-Nov-2010 claudio

Print relativ number of livelocks that happend between two systat
updates instead of showing absolut figures. Makes it easier to
estimate the "livelockyness" of a system.
OK dlg@


# 1.30 02-Nov-2010 dlg

expose the kernels network livelock counter


# 1.29 23-Sep-2010 dlg

tweak the mclgeti algorithm to behave better under load.

instead of letting hardware rings grow on every interrupt, restrict
it so it can only grow once per softclock tick. we can only punish
the rings on softclock ticks, so it make sense to only grow on
softclock tick boundaries too.

the rings are now punished after >1 lost softclock tick rather than
>2. mclgeti is now more aggressive at detecting livelock.

the rings get punished by an 8th, rather than by half.

we now allow the rings to be punished again even if the system is
already considered in livelock.

without this diff a livelocked system will have its rx ring sizes
scale up and down very rapidly, while holding the rings low for too
long. this affected throughput significantly.

discussed and tested heavily at j2k10. there are still some games
with softnet we can play, but this is a good first step.

"put it in" and ok deraadt@
ok claudio@ krw@ henning@ mcbride@

if we find out that it sucks we can pull it out again later. till then
we'll run with it and see how it goes.


Revision tags: OPENBSD_4_8_BASE
# 1.28 01-Aug-2010 blambert

don't rely on mbuf.h to pull in pool.h here either

ok miod@


# 1.27 01-Aug-2010 chl

fix use of uninitialized variable.

reported by gcc.

ok canacar@


Revision tags: OPENBSD_4_7_BASE
# 1.26 23-Nov-2009 henning

args, not that file


# 1.25 23-Nov-2009 henning

no more natpass


Revision tags: OPENBSD_4_6_BASE
# 1.24 20-Apr-2009 chl

remove unneeded argument to warnx()
remove unused variable
kill some extra blank lines

ok canacar@


# 1.23 29-Mar-2009 kettenis

Make sure systat mbufs prints the interface name even if an interface only
allocates clusters larger than 2k.

ok deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.22 27-Jan-2009 dlg

fix the mbuf view to cope with the recent change to the mclgeti allocator.

from canacar@


# 1.21 31-Dec-2008 canacar

Skip missing pool indices instead of printing errors.


# 1.20 18-Dec-2008 canacar

Print the interface livelocks if non-zero. From deraadt@


# 1.19 17-Dec-2008 canacar

Rewrite the 'mbuf' page to display mbuf usage information from system pools
and mbuf cluster statistics collected for each interface. More useful than
earlier bar graphs about mbuf types. Requested by and ok deraadt@


Revision tags: OPENBSD_4_4_BASE
# 1.18 12-Jun-2008 canacar

New display engine for systat, based on pftop. Adds new views for pf
(status, state, rule, queue). While all displays work, some keyboard
comands are not implemented yet. Other features include better handling
of display resize and scrolling for long views. Committing now to fix
the remaining issues in the tree.
Testing and comments by otto@ and harding@, ok deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 25-Feb-2007 deraadt

use the 1 line load line from 'systat vm' on all the other displays, giving
them more room. much cleaner, and it is less code too; ok deanna


Revision tags: OPENBSD_4_0_BASE
# 1.16 31-Mar-2006 deraadt

fairly simple cleanup, lots of testing done


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.15 09-Jul-2004 deraadt

post-mortem stuff can go away here too


# 1.14 03-Jul-2004 deraadt

move sysctl comment on namelist[] entry


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.13 03-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.12 19-Jun-2002 deraadt

mark which nlist[] kmem entries are not needed in the sysctl case, and which are


# 1.11 18-Jun-2002 deraadt

ANSI


# 1.10 09-Jun-2002 angelos

Use sysctl for mbstat


Revision tags: OPENBSD_3_1_BASE
# 1.9 07-Dec-2001 deraadt

move back. pvalchev -- the bug was quite obscure


# 1.8 07-Dec-2001 pvalchev

back out latest changes which cause problems on alpha/sparc64 until
they are fixed


# 1.7 23-Nov-2001 deraadt

fix signal races. use sysctl() instead of kvm where possible, and then KNF
the hell out of it; checked by miod


# 1.6 19-Nov-2001 mpech

kill more registers

millert@ ok


Revision tags: OPENBSD_3_0_BASE
# 1.5 04-May-2001 ericj

handle kvm_nlist() failing, from pr#1798.
Patch similar to the one submitted by <peterw@documenta.com.au>


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.4 19-Dec-1997 deraadt

bye bye sprintf


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE
# 1.3 26-Jun-1996 deraadt

rcsid


# 1.2 02-Jun-1996 mickey

it compiles w/ new curses


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision