summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat/mbufs.c
Commit message (Collapse)AuthorAgeFilesLines
* WARNS=2 fixes with NO_WERROR set, as there are some header issuesmarkm2001-12-121-14/+17
| | | | with namelists. use __FBSDID().
* Re-enable mbtypes statistics in the mbuf allocator. I disabled thesebmilekic2001-09-301-32/+31
| | | | | | | | | | | | | | | | | when I changed the allocator bits. This implements per-CPU mbtypes stats by keeping net number of decrements/increments of a given mbtype per-CPU and then summing all of the per-CPU mbtypes to produce the total net number of allocated mbufs of the given mbtype. Counters are carefully balanced to avoid/prevent underflows/overflows. mbtypes stats are re-enabled with the idea that we may occasionally (although very rarely) observe slight inconsistencies in the stat reporting. Most of the time, we should be fine, though. Also make appropriate modifications to netstat(1) and systat(1) to do the necessary reporting. Submitted by: Jiangyi Liu <jyliu@163.net>
* - Do not handle the per-CPU containers in mbuf code as though the cpuidsbmilekic2001-07-261-8/+5
| | | | | | | | | | | | | | | | | were indices in a dense array. The cpuids are a sparse set and treat them as such, setting up containers only for CPUs activated during mb_init(). - Fix netstat(1) and systat(1) to treat the per-CPU stats area as a sparse map, in accordance with the above. This allows us to properly boot with certain CPUs disactivated. However, if we later decide to re-activate said CPUs, we will barf until we decide to implement CPU spinon/spinoff callback hooks to allow for said CPUs' per-CPU containers to get configured on their activation. Reported by: mjacob Partially (sys/ diffs) Submitted by: mjacob
* Make sure to try hw.ncpu if kern.smp.cpus doesn't exist (i.e. on UP) whenbmilekic2001-06-231-1/+2
| | | | getting number of CPUs.
* Introduce numerous SMP friendly changes to the mbuf allocator. Namely,bmilekic2001-06-221-22/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | introduce a modified allocation mechanism for mbufs and mbuf clusters; one which can scale under SMP and which offers the possibility of resource reclamation to be implemented in the future. Notable advantages: o Reduce contention for SMP by offering per-CPU pools and locks. o Better use of data cache due to per-CPU pools. o Much less code cache pollution due to excessively large allocation macros. o Framework for `grouping' objects from same page together so as to be able to possibly free wired-down pages back to the system if they are no longer needed by the network stacks. Additional things changed with this addition: - Moved some mbuf specific declarations and initializations from sys/conf/param.c into mbuf-specific code where they belong. - m_getclr() has been renamed to m_get_clrd() because the old name is really confusing. m_getclr() HAS been preserved though and is defined to the new name. No tree sweep has been done "to change the interface," as the old name will continue to be supported and is not depracated. The change was merely done because m_getclr() sounds too much like "m_get a cluster." - TEMPORARILY disabled mbtypes statistics displaying in netstat(1) and systat(1) (see TODO below). - Fixed systat(1) to display number of "free mbufs" based on new per-CPU stat structures. - Fixed netstat(1) to display new per-CPU stats based on sysctl-exported per-CPU stat structures. All infos are fetched via sysctl. TODO (in order of priority): - Re-enable mbtypes statistics in both netstat(1) and systat(1) after introducing an SMP friendly way to collect the mbtypes stats under the already introduced per-CPU locks (i.e. hopefully don't use atomic() - it seems too costly for a mere stat update, especially when other locks are already present). - Optionally have systat(1) display not only "total free mbufs" but also "total free mbufs per CPU pool." - Fix minor length-fetching issues in netstat(1) related to recently re-enabled option to read mbuf stats from a core file. - Move reference counters at least for mbuf clusters into an unused portion of the cluster itself, to save space and need to allocate a counter. - Look into introducing resource freeing possibly from a kproc. Reviewed by (in parts): jlemon, jake, silby, terry Tested by: jlemon (Intel & Alpha), mjacob (Intel & Alpha) Preliminary performance measurements: jlemon (and me, obviously) URL: http://people.freebsd.org/~bmilekic/mb_alloc/
* Fix systat to use the kern.ipc.mbtypes sysctl instead of referencing aalfred2000-07-151-34/+44
| | | | | | | | | structure member that doesn't exist anymore. Use getsysctlbyname for kern.ipc.mbstat instead of sysctl. Use netstat's method of displaying values from mtnames. Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Missed by PR: 19809
* systat is way too comfortable with curses internals...peter1999-08-301-2/+2
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Quiet many compiler warnings.obrien1998-10-081-2/+2
|
* o Use snprintf rather than sprintfimp1998-06-091-3/+3
| | | | | | | | | | | o Add more checks for buffer overflows o Use snprintf rather than strcat/cpy and have better checks for max length exceeded. Most of these changes are not exploitable buffer overruns, but it never hurts to be safe. Inspired by and obtained from: OpenBSD
* Add a mode to display ICMP statistics.wollman1997-09-241-2/+3
| | | | Inspired by: IRIX netstat -C
* Use new sysctl(3) interface to mbuf statistics. While we're at it,wollman1997-02-241-21/+45
| | | | count free mbufs correctly.
* Fix a bug in the mbufs display, seen when there was a large numberjdp1996-05-271-3/+2
| | | | | | | of mbufs in use. If the number reached, e.g., 4 digits, then later decreased to 3 digits, the last digit of the 4-digit number was not erased. This caused the display to show a wildly high number of mbufs in use.
* Remove trailing whitespace.rgrimes1995-05-301-1/+1
|
* Get rid of _PATH_UNIX completely; use getbootfile(3) instead.wollman1994-09-241-1/+1
| | | | | | | DANGER WILL ROBINSON! _PATH_UNIX is currently defined as the literal string "don't use this". I am of two minds about this myself, but wanted to get something into the tree as quickly as possible.
* BSD 4.4 Lite Usr.bin Sourcesrgrimes1994-05-271-0/+163
OpenPOWER on IntegriCloud