Commit Graph

80 Commits

Author SHA1 Message Date
christos f73c6e5980 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).
2006-08-23 17:19:32 +00:00
kardel de4337ab21 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
2006-06-07 22:33:33 +00:00
yamt b9eb99f927 iostat_find/disk_find: constify and simplify. 2006-04-21 13:53:30 +00:00
yamt f7fc2f12db remove some unnecessary #include. 2006-04-21 13:51:24 +00:00
yamt 6237cabc7d whitespace. 2006-04-21 13:48:57 +00:00
blymn 10df330c85 Prefix iostat structure elements with io_ 2006-04-20 12:13:51 +00:00
blymn 3c0adb7d99 Make i/o statistics collection more generic, include tape drives and
nfs mounts in the set of devices that statistics will be reported on.
2006-04-14 13:09:05 +00:00
perry 144515ce1a u_intN_t -> uintN_t 2005-12-26 18:41:36 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt aec75b1cc6 - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
  have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
  from sys/bufq.h to sys/bufq_impl.h.
  (is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c.  (not tested)
2005-10-15 17:29:10 +00:00
yamt 6f645a09cb introduce a variant of disk_attach/detach, for pseudo disks
which is opened by user before being attached.
2005-08-20 12:00:01 +00:00
christos efb6943313 - add const.
- remove unnecessary casts.
- add __UNCONST casts and mark them with XXXUNCONST as necessary.
2005-05-29 22:24:14 +00:00
yamt 99229e5d39 introduce a function to drain bufq and use it where appropriate. 2005-03-31 11:28:53 +00:00
fvdl af5309b07c Change the 'sz' variable in bounds_check_* to int64_t to avoid overflows
when a very large blocknumber is passed in.
2005-02-08 08:56:21 +00:00
christos 4cf9bb2fc2 Change an if/panic statement to a KASSERT and disable a chatty printf. 2005-02-06 23:57:29 +00:00
yamt eb54e7db24 lookup bufq using link_set rather than a switch statement. 2004-11-25 04:52:23 +00:00
yamt 05f25dcc2a move buffer queue related stuffs from buf.h to their own header, bufq.h. 2004-10-28 07:07:35 +00:00
thorpej 99e5d764c1 - Eliminate the need to call disk_init().
- disk_count needs to be protected with disklist_slock, too.
2004-10-15 07:19:01 +00:00
yamt 1c2a2dcad3 move i/o schedulers to their own files.
namely, from kern/subr_disk.c to kern/bufq_{fcfs,disksort,readprio,priocscan}.c.
2004-10-14 05:12:28 +00:00
thorpej baefaf4422 Work-in-progress implementation of "wedges", a new way to represent
partitions in the NetBSD kernel.  See discussion on tech-kern for details.
2004-09-25 03:30:44 +00:00
yamt f75335b469 - add a function prototype.
- consitify.
2004-03-09 12:23:07 +00:00
yamt 395e9958f2 change the way to handle NEW_BUFQ_STRATEGY option.
instead of putting #ifdefs into each drivers,
use a global variable to indicate default strategy.

XXX should have a way to specify other strategies.
2004-02-28 06:28:47 +00:00
yamt a3b2d1879c add a new bufq strategy, BUFQ_PRIOCSCAN (per-priority CSCAN).
discussed on tech-kern@
2004-01-10 14:49:44 +00:00
yamt 8e92859632 rev.1.55 didn't handle BUFQ_SORT_CYLINDER case correctly.
pointed by Juergen Hannken-Illjes.  patch provided by him.
2003-12-06 17:23:22 +00:00
he b2518d1259 Make sure buf_inorder() returns a value under all conditions. 2003-12-06 01:21:23 +00:00
yamt a9133ee855 buf_inorder: deal with 64-bit daddr_t correctly. 2003-12-05 10:16:16 +00:00
atatat 13f8d2ce5f Dynamic sysctl.
Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al.  Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded.  Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment.  I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
2003-12-04 19:38:21 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
dsl 6ff706ac19 CONSTCONT should have been CONSTCOND 2003-04-13 09:08:04 +00:00
dsl b757e31c2a Fix error message for 64bit daddr_t 2003-04-13 07:51:30 +00:00
fvdl 2257bf89d4 Add a bounds_check_with_mediasize function, which is intended
for checking RAW_PART transfers (and later raw disk devices).
2003-04-03 22:20:24 +00:00
enami 8f82ec28ee Factor out the COMPAT_16 code. 2002-11-06 02:31:34 +00:00
mrg 3e8df71794 - do the COMPAT_16 dance in sysctl_diskstats() for the where == NULL case
as well.  pointed out by enami@.
- defflag COMPAT_16.
2002-11-05 13:22:32 +00:00
mrg 5cad86b3ea repair backwards compatibility with netbsd 1.6 - if we are not given the
wanted sizeof(struct disk_sysctl), use the old size.  for non-COMPAT_16,
however, we return EINVAL so that all future programs are forced into
passing the wanted size.  1.6 iostat(8) works with -current kernel again.

as seen on tech-kern.
2002-11-04 03:50:07 +00:00
simonb 307ae1b2e5 When calculating the space needed for the data, use the supplied
userland structure size (if passed in).
Use the supplied userland structure size (if passed in) to check if
there is enough room to copyout the next structure.
2002-11-01 15:20:03 +00:00
mrg 603098b9b5 implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
	- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
	when processing hw.diskstats, add the read&write bytes/transfers for
	the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail.  however, the next time this is
change it will not fail again.

this is just the kernel portion.
2002-11-01 11:31:50 +00:00
enami fc1c4219ef Make this works with QUEUEDEBUG defined; don't use queue pointer after
removing an element from queue.
2002-11-01 03:34:07 +00:00
enami 5eec77bccd Cosmetic changes. 2002-11-01 03:32:21 +00:00
hannken 815491c0b3 Remove the old device buffer queue interface.
Approved by: Jason R. Thorpe <thorpej@wasabisystems.com>
2002-08-30 15:43:36 +00:00
hannken 91f71a4f61 The buffer returned by BUFQ_PEEK must remain the same until BUFQ_GET is
called. It may be used as the "current" buffer.
2002-07-23 14:00:16 +00:00
hannken 7de36862a8 Rename bufq_init() to bufq_alloc().
Add bufq_free() to remove a buffer queue.
Avoid MALLOC while holding a spinlock.

From Chuck Silvers.
2002-07-21 15:32:17 +00:00
hannken 10ff5e6607 Implement a new device buffer queue interface.
One basic struct, a function to setup a queue with a specific strategy and
three macros to put buf's into the queue, get and remove the next buf or
get the next buf without removal.

The BUFQ_XXX interface will be removed in the future.
The B_ORDERED flag is not longer supported.

Approved by: Jason R. Thorpe <thorpej@wasabisystems.com>
2002-07-16 18:03:17 +00:00
yamt 5154ea5e5b constify diskerr(). 2002-06-28 16:37:20 +00:00
enami 3528e53ca0 Use sizeof correctly. Fixes PR#15613. 2002-02-16 02:11:43 +00:00
enami 233c254079 - Wrap long line.
- Remove unnecessary semi-colon.
2002-02-16 02:07:56 +00:00
simonb 4aceab2a3d Remember to update the "size copied" counter in sysctl_diskstats(). 2002-01-28 03:33:55 +00:00
simonb 9e42930807 Use TAILQ_FOREACH(). 2002-01-28 03:12:13 +00:00
simonb ed6b438e40 Implement the hw.disknames and hw.diskstats sysctl's that have been listed
in <sys/sysctl.h> since day one but never implemented.
2002-01-27 12:41:07 +00:00
enami ba7af71cd5 Use cached pointer to next buf instead of re-fetching it. GCC actually
generates different code.
2001-11-30 01:31:30 +00:00
lukem 43369f69d3 add RCSID 2001-11-13 13:33:44 +00:00