Home | History | Annotate | Download | only in kern
History log of /src/sys/kern/subr_iostat.c
RevisionDateAuthorComments
 1.26  04-May-2024  mlelstv Account for trailing NUL bytes when calculating userland buffer size.
 1.25  22-May-2019  hannken Implement disk_rename()/iostat_rename() to rename a disk.

Use it from zvol_rename_minor() when renaming a ZVOL.
 1.24  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.23  01-Jun-2017  chs branches: 1.23.8; 1.23.10;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.22  05-Mar-2017  mlelstv Enhance disk metrics by calculating a weighted sum that is incremented
by the number of concurrent I/O requests. Also introduce a new disk_wait()
function to measure requests waiting in a bufq.
iostat -y now reports data about waiting and active requests.

So far only drivers using dksubr and dk, ccd, wd and xbd collect data about
waiting requests.
 1.21  18-Oct-2014  snj branches: 1.21.2; 1.21.4; 1.21.6;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.20  25-Feb-2014  pooka Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
 1.19  30-Nov-2009  pooka branches: 1.19.12; 1.19.22; 1.19.26;
Create CTL_HW before creating nodes on top of it (sysctl constructors
run in "random" order).
 1.18  16-Sep-2009  pooka Replace a large number of link set based sysctl node creations with
calls from subsystem constructors. Benefits both future kernel
modules and rump.

no change to sysctl nodes on i386/MONOLITHIC & build tested i386/ALL
 1.17  04-Apr-2009  ad Add disk_isbusy(), iostat_isbusy().
 1.16  22-Jan-2009  yamt branches: 1.16.2;
malloc -> kmem_alloc
 1.15  20-May-2008  ad branches: 1.15.6; 1.15.8;
Remove pointless COMPAT ifdef.
 1.14  28-Apr-2008  martin branches: 1.14.2;
Remove clause 3 and 4 from TNF licenses
 1.13  09-Feb-2007  ad branches: 1.13.40; 1.13.42; 1.13.44;
Merge newlock2 to head.
 1.12  07-Dec-2006  ad iostat: avoid sleeping with a held simple_lock.
 1.11  23-Aug-2006  christos branches: 1.11.2; 1.11.4; 1.11.6;
Change iostat_alloc() to take the parent pointer and the name directly, so
that callers are not responsible for initializing the fields. Store the name
inside the struct instead of maintaining a pointer to external storage, or
leaked memory (nfs case).
 1.10  07-Jun-2006  kardel branches: 1.10.4;
merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
 1.9  21-Apr-2006  yamt branches: 1.9.2; 1.9.4; 1.9.6; 1.9.8;
iostat_alloc: don't forget to initialize io_busy etc.
fix weird "time" in iostat.
 1.8  21-Apr-2006  yamt iostat_find/disk_find: constify and simplify.
 1.7  21-Apr-2006  yamt sysctl_io_stats_setup: HW_IOSTATS is iostats, not drivestats.
 1.6  21-Apr-2006  yamt remove some unnecessary #include.
 1.5  21-Apr-2006  yamt iostat_alloc: use waitok allocation.
 1.4  21-Apr-2006  yamt unwrap a short line.
 1.3  21-Apr-2006  yamt whitespace.
 1.2  20-Apr-2006  blymn Prefix iostat structure elements with io_
 1.1  14-Apr-2006  blymn branches: 1.1.2;
Functions to support io statistics collection.
 1.1.2.3  11-May-2006  elad sync with head
 1.1.2.2  19-Apr-2006  elad sync with head.
 1.1.2.1  14-Apr-2006  elad file subr_iostat.c was added on branch elad-kernelauth on 2006-04-19 05:14:00 +0000
 1.9.8.2  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.9.8.1  21-Apr-2006  tron file subr_iostat.c was added on branch peter-altq on 2006-05-24 15:50:41 +0000
 1.9.6.4  03-Sep-2006  yamt sync with head.
 1.9.6.3  26-Jun-2006  yamt sync with head.
 1.9.6.2  24-May-2006  yamt sync with head.
 1.9.6.1  21-Apr-2006  yamt file subr_iostat.c was added on branch yamt-pdpolicy on 2006-05-24 10:58:41 +0000
 1.9.4.1  19-Jun-2006  chap Sync with head.
 1.9.2.2  22-Apr-2006  simonb Sync with head.
 1.9.2.1  21-Apr-2006  simonb file subr_iostat.c was added on branch simonb-timecounters on 2006-04-22 11:39:59 +0000
 1.10.4.4  26-Feb-2007  yamt sync with head.
 1.10.4.3  30-Dec-2006  yamt sync with head.
 1.10.4.2  21-Jun-2006  yamt sync with head.
 1.10.4.1  07-Jun-2006  yamt file subr_iostat.c was added on branch yamt-lazymbuf on 2006-06-21 15:09:38 +0000
 1.11.6.1  10-Dec-2006  yamt sync with head.
 1.11.4.2  09-Sep-2006  rpaulo sync with head
 1.11.4.1  23-Aug-2006  rpaulo file subr_iostat.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:16 +0000
 1.11.2.2  04-Feb-2007  ad Replace lockmgr() locks.
 1.11.2.1  12-Jan-2007  ad Sync with head.
 1.13.44.3  11-Mar-2010  yamt sync with head
 1.13.44.2  04-May-2009  yamt sync with head.
 1.13.44.1  16-May-2008  yamt sync with head.
 1.13.42.2  04-Jun-2008  yamt sync with head
 1.13.42.1  18-May-2008  yamt sync with head.
 1.13.40.1  02-Jun-2008  mjf Sync with HEAD.
 1.14.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.15.8.1  04-Apr-2009  snj Pull up following revision(s) (requested by ad in ticket #657):
sys/kern/subr_disk.c: revision 1.95
sys/kern/subr_iostat.c: revision 1.17
sys/sys/disk.h: revision 1.52
sys/sys/iostat.h: revision 1.10
Add disk_isbusy(), iostat_isbusy().
 1.15.6.2  28-Apr-2009  skrll Sync with HEAD.
 1.15.6.1  03-Mar-2009  skrll Sync with HEAD.
 1.16.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.19.26.1  18-May-2014  rmind sync with head
 1.19.22.2  03-Dec-2017  jdolecek update from HEAD
 1.19.22.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.12.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.21.6.1  21-Apr-2017  bouyer Sync with HEAD
 1.21.4.1  20-Mar-2017  pgoyette Sync with HEAD
 1.21.2.1  28-Aug-2017  skrll Sync with HEAD
 1.23.10.1  10-Jun-2019  christos Sync with HEAD
 1.23.8.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

RSS XML Feed