Commit Graph

56 Commits

Author SHA1 Message Date
jmcneill 47379c8458 Don't forget to deregister with PMF on detach. 2008-03-09 19:18:25 +00:00
jmcneill fdf8cc9718 Replace shutdownhook with PMF power handler. 2008-03-09 19:15:01 +00:00
ad 0664a0459b Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
2008-01-04 21:17:40 +00:00
ad 598ab03ad0 Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
2007-12-05 07:06:50 +00:00
xtraeme 1b0de52cf2 Use sc_mutex (which runs at IPL_BIO) to protect the DIOC[GS]STRATEGY
ioctl ops, sorry didn't see it before.
2007-11-12 19:01:07 +00:00
xtraeme 4ffff27911 Implement DIOCGSTRATEGY and DIOCSSTRATEGY for dkctl <foo0> strategy. 2007-11-12 14:45:23 +00:00
ad 2af68666da Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
2007-10-08 16:41:05 +00:00
ad eb171eaaa7 It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 12:50:17 +00:00
ad b5a9ff06f1 Replace some uses of lockmgr(). 2007-07-21 19:51:47 +00:00
tron c021b87a9d Reset error code if an ioctl() request is not handled by the generic
disk framework. This stops ld(4) from returning an error for various
ioctl() requests which actually *did* work. As a result fdisk(8) and
therefore also sysinst(8) work with ld(4) devices once again.

Based on a patch supplied by Todd Kover in PR kern/36244, successfully
tested with ld(4)@icp(4).
2007-04-30 17:23:09 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
riz 52138eeaf6 Defer dkwedge_discover() until after interrupts are enabled. This
allows a kernel with options DKWEDGE_AUTODISCOVER to boot
on a machine with a twa(4) card.

ok matt@
2007-02-22 22:28:32 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
riz 35ed82b748 Add disk-info properties to ld(4), based on Jason Thorpe's similar
code in wd(4).

OK ad, cube
2007-02-08 03:19:42 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
thorpej 39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +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
christos 7df254d9f7 avoid variable shadowing. 2005-05-30 04:44:52 +00:00
yamt 99229e5d39 introduce a function to drain bufq and use it where appropriate. 2005-03-31 11:28:53 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
briggs fb9f110c8c Use aprint_*() instead of printf() at attach time. 2005-02-08 05:16:17 +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 c22daf01f0 Implement the DIOCCACHESYNC ioctl. 2004-10-26 22:46:13 +00:00
jdolecek f5254bdba7 ldioctl(): fix typo in check for lockmgr() return value introduced
with the wedge support, which caused premature return and left dk_openlock
locked, leading to lockmgr() panic on close; newfs of ld disk now works again
2004-10-17 17:02:48 +00:00
thorpej 46cfcf0eb8 Add support for wedges to the logical disk driver. 2004-09-25 04:28:08 +00:00
thorpej b560f85cc5 Use ANSI function decls, sprinkle static. 2004-08-30 00:34:41 +00:00
dbj aeec9b8f23 use uint64 instead of int for sc_secperunit 2004-07-20 15:44:20 +00:00
tls 14cd9beeae Don't use BUFQ_FCFS. It degrades performance both for "smart" (Mylex
ExtremeRAID with NV cache) and "dumb" (3ware 6410) ld providers.

Instead, use the default buffer queue policy.

With the 3ware adapter, using the read priority strategy instead of FCFS,
for three extractions of pkgsrc, took 329 seconds instead of 331 -- but
with a dramatic improvement in perceived system response (latency for
I/O outside the main stream).

With the Mylex adapter, the improvement was dramatic: using read priority
instead of FCFS yielded an improvement from 381 seconds to 135 seconds!
There was a less-noticeable improvement in perceived latency as well.

The other disk drivers currently hard-wired to FCFS or another policy
should probably be changed as well.
2004-03-22 17:30:33 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
thorpej 76464bb996 * Don't wait for commands to drain when adjusting the queue length.
Instead, wait when it's really needed, when detaching.  Project
  draining from spruious wakeups.
* Don't flush the controller's cache when detaching; we can't do it
  reliably, as the controller probably things the array drive no
  longer exists.  The cache is already flushed in ldclose() so this
  should be no problem.
2003-06-13 02:32:27 +00:00
thorpej 47edad1115 Always queue transfers in the ld driver to prevent transient resource
shortages in the back-ends from aborting transfers.

Reviewed by ad@.
2003-06-07 23:37:24 +00:00
thorpej 4aef050969 Add DIOCKLABEL support. Fixes PR kern/21605 (Luke Mewburn). 2003-05-17 16:11:52 +00:00
itojun ce084afabe use strlcpy 2003-05-16 15:34:25 +00:00
thorpej e43fecb228 Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself.  This paves the way for some future changes.
2003-05-10 23:12:28 +00:00
thorpej 8dc5018716 If the upper-layer provides a geometry, use it. 2003-01-27 02:43:30 +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
jdolecek e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +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 96ea8912e6 Convert to new device buffer queue interface. 2002-07-20 11:28:07 +00:00
drochner 3c33c0f57e Since the minor numbers belonging to the partitions of a disk are not
contigous anymore, we can't call vdevgone() for the whole range at once.
(we should probably change the vdevgone() interface)
This also fixes some wrong use of DISKUNIT().
2002-05-08 15:49:07 +00:00
lukem 2bbe2de647 add RCSIDs 2001-11-13 05:32:49 +00:00
thorpej 8b59971a0d Don't compare bp->b_dev against RAW_PART; use the `part' local variable
instead.
2001-09-06 00:47:56 +00:00
ad b25d5c0666 Pasto; found by tls. 2001-07-24 21:55:35 +00:00
ad bfac43a1c8 Centralise the geometry fudge. 2001-06-10 10:48:42 +00:00
lukem 9d02aae3a9 minor lint 2001-04-30 02:44:53 +00:00
ad 8067f991df Allow for draining/adjusting the queue. 2001-02-04 17:15:37 +00:00