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.
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.
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.
- 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.
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>
to go to the inversion list is incomplete. If the cylinders are equal
block numbers must be checked.
This caused lockups if some buffers with the same cylinder were cycling
through the list, as it may happen with softdep enabled.
Fixes PR #9197.
be issued/completed in order; that is, provide a barrier for I/O queues.
- Change the buffer driver queue links to a TAILQ, rather than using
a home-grown equivalent. Provide BUFQ_*() macros to manipulate buffer
queues; these deal with the barrier provided by B_ORDERED.
- Update disksort() accordingly, and provide 3 versions:
- disksort_cylinder(): historical disksort(), which keys on
b_cylinder (and b_blkno for the case when b_cylinder matches).
- disksort_blkno(): sorts only on b_blkno. Essentially the
same as disksort_cylinder(), but with fewer comparisons.
- disksort_tail(): requests are simply inserted into the queue
at the tail. This is provided as an option so that drivers
can simply have a pointer to the appropriate sort function.
Note that disksort() now pays attention to B_ORDERED.
- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.
- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.
- Several new functions for attaching and detaching disks, and
handling metrics calculation.
Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.
For usage and architectural details, see the forthcoming disk(9) manual
page.