Commit Graph

260 Commits

Author SHA1 Message Date
oster e644abfe94 Make sure we close auto-configured components appropriately when
attempting a rebuild-in-place.
2000-02-24 04:39:41 +00:00
oster c5961cfba3 Garbage collect some unused stuff. Include rf_kintf.h for a
function prototype.
2000-02-24 03:52:15 +00:00
oster 851a2cdcd8 - record the pointer to the DiskQueueSW so we can use that when
we hot-add a spare.
- use the above info when adding a spare.
2000-02-24 03:48:41 +00:00
oster 9e81bc058e Now that we have the information available, use the general maxOutstanding
value for the RAID set, rather than looking at Queue[0][0] (which may not
exist).
2000-02-24 02:55:05 +00:00
oster 99f070bab8 - mod_counter needs to get incremented more often.
- use raid_init_component_labels instead of hand-rolling a component_label.
(missed doing this for the rf_used_spare case when updating component labels).
- fix serial number initialization in raid_init_component_labels
2000-02-24 01:23:05 +00:00
oster fb13ce76fc - make sure we note the parity status in the autoconfig case.
- also, make sure we grab the serial number from the component labels
when we autoconfig.
2000-02-24 01:22:32 +00:00
oster d91ecfbcfd Be more aggressive about updating component labels in the event
of a real component failure (or a simulated failure):
- add 'numNewFailures' to keep track of the number of disk failures
since mod_counter was last updated for each component label.
- make sure we call rf_update_component_labels() upon any component failure,
real or simulated.
2000-02-23 03:44:02 +00:00
oster e7f3dc2ec9 blockSize for the component label is already set correctly here. 2000-02-23 02:11:05 +00:00
oster 0c43bf18f0 - cleanup of more component label code
- make current default label values available everywhere
- make sure numBlocks and blockSize in component labels get initialized
for all component labels
- check for component size to be smaller than or equal to the partition size
when autoconfiguring
2000-02-23 02:04:21 +00:00
oster 6aaac32240 Do a better job of (re)initializing the component labels after
a reconstruct or a copyback.
2000-02-23 02:03:03 +00:00
oster d84e4ed019 Make a note of autoconfigured components. 2000-02-23 02:01:55 +00:00
oster e0ab2f3d0f Correct a comment. 2000-02-23 00:37:11 +00:00
oster 214822e08c Note the fact that the first arg of raidinit() may be bogus in
the autoconfig case (the value of the first arg never gets used, but...).
2000-02-22 23:13:15 +00:00
oster e8ff7f6155 Bounds-check the 'last unit' a little more closely. 2000-02-22 16:07:02 +00:00
oster fb56415023 Add a few comments, and an indicator of whether or not an autoconfig set
is 'rootable'.
2000-02-22 03:39:47 +00:00
oster bd2230fd09 - implement additional component checking before autoconfiguration
- make component label setting work again(!!!!)
2000-02-22 03:38:42 +00:00
oster afccbaa6d7 Umm.. let's set 'numraid' to something useful before we try to use it. 2000-02-21 23:33:45 +00:00
oster 7deba340d7 Some of these function names are bad enough that no one else would probably
pick them, but preface them with rf_ anyway.
2000-02-16 01:10:44 +00:00
oster 445591e874 Get recent changes into the tree:
- make component_label variables more consistent (==> clabel)
- re-work incorrect component configuration code
- re-work disk configuration code
- cleanup initial configuration of raidPtr info
- add auto-detection of components and RAID sets (Disabled, for now)
- allow / on RAID sets (Disabled, for now)
- rename "config_disk_queue" to "rf_ConfigureDiskQueue" and properly prototype
in rf_diskqueue.h
- protect some headers with #if _KERNEL  (XXX this needs to be fixed properly)
  and cleanup header formatting.
- expand the component labels (yes, they should be backward/forward compatible)
- other bits and pieces (some function names are still bogus, and will get
changed soon)
2000-02-13 04:53:57 +00:00
oster edc931efea Make this compile without warnings on alphas.
(Problem noted by Aaron J. Grier)
2000-02-12 16:06:27 +00:00
thorpej dc59bc1db3 Update for sys/buf.h/disksort_*() changes. 2000-01-21 23:39:55 +00:00
oster 138d8fef04 Fix typo + cleanup a bit. 2000-01-15 01:57:57 +00:00
oster ef035f5a7b Make more 80-column friendly. No functionality changes. 2000-01-14 04:03:52 +00:00
oster 11e019370e "fix" a serious problem with RF_AccTraceEntry_t tracerec stuff.
XXX the "fix" is incorrect, but that makes it consistent with
some of the other code here.  A this point you should *not* be
thinking about using this code. (At all.) (And I mean it.)
2000-01-14 01:00:26 +00:00
oster ee867c7fdf Add some debugging printfs. 2000-01-14 00:57:57 +00:00
oster ec84f30ddd If we can't malloc a RF_ShutdownList then we should return ENOMEM right away.
Waiting for more kernel memory to come along can cause more problems than
we're willing to deal with right now.
2000-01-13 23:41:18 +00:00
oster 2c4bbb1b26 At (closer to) 80-columns, this may actually be readable code. 2000-01-09 04:35:13 +00:00
oster f2a8aaee02 Garbage collect unused code. 2000-01-09 03:44:33 +00:00
oster 7ce0db89f9 Nuke more debugging stuff and cleanup a tad. 2000-01-09 03:39:13 +00:00
oster b0caf96f87 It's got to help to check the *right* value if you care what
RF_Malloc() is returning.
2000-01-09 03:28:11 +00:00
oster fbd3b6b396 Another one bites the dust. 2000-01-09 03:17:12 +00:00
oster 87ec1ad21b Nuke dependency on rf_diskthreads.h 2000-01-09 03:15:59 +00:00
oster 4a54cff7d7 Nuke dependencies on rf_cpuutils.h. 2000-01-09 03:14:32 +00:00
oster 23c4c71c8f By popular demand (Hi Thor!) make the cylinder size in a default
disklabel be the size of the (data part) of the stripe.
2000-01-09 02:56:13 +00:00
oster 754613774a rf_cpuutil.c isn't useful for the kernel driver.
*poof* *poof*
2000-01-09 02:23:21 +00:00
oster c8723703d2 Not sure why this file was still around since it's really not required.
*poof*
2000-01-09 02:05:12 +00:00
oster 6e92bd4525 Nuke unused debugging stuff. Clean up a whole bunch of comments. 2000-01-09 01:45:58 +00:00
oster a5dcdf8572 Nuke a couple of obsolete comments. 2000-01-09 01:34:29 +00:00
oster c8730b35e6 - move a bunch of function prototypes to rf_kintf.h
- general cleanup of a number of prototypes that were scattered around.
2000-01-09 01:29:27 +00:00
oster 08817bcd50 Nuke #if 0'ed code. 2000-01-09 01:12:05 +00:00
oster cdb6add0f7 Nuke desc->tid. 2000-01-09 00:00:18 +00:00
oster 37c75452f4 Time's up. This file is no longer needed. "toodles." *punt* 2000-01-08 23:54:26 +00:00
oster 418d4b8471 - more cleanup of rf_get_threadid() and debugging printfs 2000-01-08 23:45:05 +00:00
oster 524894d6f2 Make raidPtr a 'RF_Raid_t *' like it's supposed to be. 2000-01-08 23:02:16 +00:00
oster 04719e3adc - nuke calls to rf_get_threadid() and associated #include
- change a bunch of debugging printfs from
  "[%d] ...", tid   (where tid is the "thread id")
to
  "raid%d: ...", raidPtr->raidid
- other minor rototillage
2000-01-08 22:57:30 +00:00
oster 23864e9422 Bail if rf_numParityRegions is not > 0. Cleanup a comment. 2000-01-08 05:13:26 +00:00
oster 0d2f49b054 Nuke stale comment. 2000-01-08 03:49:37 +00:00
oster e7fe279817 Minor cleanup. 2000-01-08 03:34:31 +00:00
oster db96c5344b Nuke some (now) incorrect comments. More minor cleanup. 2000-01-08 02:04:06 +00:00
oster ef979643a7 Replace raidPtrs[unit] with just raidPtr, and assign the former to the
later early on in raidioctl().  Code is easier to read now too.
2000-01-08 01:52:42 +00:00
oster b9a1fe405c Minor tillage on the raidioctl() stuff. More cleanup to follow.
No functional changes.
2000-01-08 01:37:37 +00:00
oster a4ea38dbe8 Nuke an unneeded #ifdef (__NetBSD__) 2000-01-08 01:18:36 +00:00
oster 91273673e7 In RAIDFRAME_CONFIGURE, don't set values in raidPtrs[unit] unless
the configuration was successful.  Noted by Peter Galbavy of OpenBSD.
2000-01-07 13:57:20 +00:00
oster bf2d4a40db rf_GetNextReconEvent() is already prototyped in rf_revent.h.
minor cleanup
2000-01-07 03:56:14 +00:00
oster 12dacda256 nuke one call to rf_get_threadid() and cleanup rf_State_Cleanup a bit. 2000-01-07 03:47:15 +00:00
oster bf081bf6eb Nuke: #include "rf_threadid.h" and call to rf_get_threadid(). 2000-01-07 03:43:39 +00:00
oster 48301a8dae Nuke: #include "rf_threadid.h". 2000-01-07 03:40:56 +00:00
oster e5ce17d0eb Nuke RF_DECLARE_GLOBAL_THREADID, rf_setup_threadid(), rf_shutdown_threadid(),
and rf_assign_threadid().  rf_threadid.h, your days are numbered.
2000-01-07 03:25:34 +00:00
oster 86f362fb97 Nuke unused #define. 2000-01-07 03:04:41 +00:00
oster 5f144eaa4b Shorten IO_BUF_ERR macro by one (unused) arg. 2000-01-07 03:03:44 +00:00
oster 51380e0e8c - bail if we can't allocate memory for raid_softc's. Set 'numraid' as
appropriate for that condition.
- nuke some debugging stuff that we hope we'll never need again
- minor cleanups
2000-01-06 02:06:41 +00:00
oster d4dfa2a664 Make sure we really get something back from RF_Malloc before we use it. 2000-01-05 04:15:30 +00:00
oster 77ab4d1598 - update RF_CREATE_THREAD to handle a 'process name' argument.
- fire up a new thread for parity re-writes, copybacks, and reconstructs.
  The ioctl's which trigger these actions now return immediately.
- add progress accounting for the above actions.
- minor rototillage of rf_netbsdkintf.c to deal with all of the above.
2000-01-05 02:57:28 +00:00
oster 28c2380f21 Nuke a bunch of debugging cruft. No functional changes. 1999-12-15 02:02:16 +00:00
oster fe0726b921 Whoops! Neglected to initialize the buffer queues for anything other
than raid0.  Fix that...
1999-12-14 15:27:00 +00:00
oster c8753ea619 Rework how we do the 'wakeup' when an IO completes. 1999-12-12 20:52:37 +00:00
oster 706e3c13c0 Rename rf_DoAccessKernel() to raidstart() and cleanup arguments. 1999-12-12 20:52:16 +00:00
oster e8a639b1df Rototill the IO throttle code. Rename rf_DoAccessKernel() to raidstart()
and cleanup arguments.  While we're here, cleanup raidstrategy(), and nuke
a bunch of unused debugging stuff.

RAIDframe + softdeps now play very nicely together.
1999-12-12 20:51:41 +00:00
oster a0d72cb555 Trust only the data disk if the mirror is not known to be up-to-date.
(this should have been committed with a previous fix for the same
problem in another function in this file :( )
1999-12-09 02:26:09 +00:00
oster bd19af5aad Nuke what's left of the DFSTRACE stuff. 1999-12-07 02:54:08 +00:00
oster e65f9b7c87 More cleanup. DKUSAGE (what little was left of it) goes bye-bye. 1999-12-07 02:40:27 +00:00
oster a38b721e5f Nuke the last few bits of RF_DEBUG_ATOMIC that should have
disappeared a while back.
1999-12-07 02:13:28 +00:00
oster bed152a4e7 We don't support RF_DAG_TEST_ACCESS. 1999-12-03 03:35:30 +00:00
oster 128e2e90c5 Nuke some duplicate code. 1999-12-03 03:18:45 +00:00
oster a038f90588 Kernel memory is not to be wasted. If we're bailing out because of an error,
give any allocated memory back to the kernel so someone else can use it.
1999-12-03 03:06:44 +00:00
oster 3888a71ad1 Move LIST_INIT() to a more appropriate place. 1999-12-03 02:43:22 +00:00
oster 5fd68b5d02 We must initialize bp->b_dep in InitBP(). 1999-11-18 13:28:06 +00:00
oster e589155692 Remove some minor stuff that wasn't right, and wasn't even really used. 1999-11-17 01:16:37 +00:00
oster 3949e74f78 If we have a choice: do not trust the parity disk for read
balancing in a RAID 1 set if we know that the parity might not
be up-to-date.  Thanks to Thor for bringing this to my attention.
1999-11-09 03:07:20 +00:00
oster fe5b29ca42 Nuke unused prototype. 1999-09-08 02:01:55 +00:00
oster 83abb87d9a Garbage collect more unused stuff. 1999-09-05 03:05:55 +00:00
oster 9c01870db1 Remove more unused stuff. 1999-09-05 02:54:09 +00:00
oster cfbdda8843 Garbage collect some more stuff. 1999-09-05 02:24:58 +00:00
oster 6158faa69d Cleanup a bit more. 1999-09-05 01:58:11 +00:00
oster e57673d0d4 Remove one of the two bzero calls in RF_Calloc -- the 2nd one doesn't
buy us anything at all.
1999-09-05 01:46:35 +00:00
oster d8144e5848 More cleanup of unused stuff. This time we nuke a bunch of memory
allocation stuff.
1999-09-04 21:11:21 +00:00
oster cfd861fcd8 Minor cleanup of (now) unneeded RF_UTILITY checks. 1999-09-04 16:26:30 +00:00
oster b1615831d2 Nuke some unused code which, were it enabled, might be useful for
performance measurement, but which would cause data corruption.
1999-08-26 02:40:27 +00:00
oster 770de7bb5a Print a error message instead of panicing in rf_RecoveryPQFunc(). 1999-08-15 03:44:46 +00:00
oster d516e7b571 Make these compile with RF_INCLUDE_RAID6. 1999-08-15 02:36:40 +00:00
oster ff6d7dd494 Cleanup a bit. 1999-08-15 02:36:03 +00:00
oster 07cc4855f1 Minor cleanup. No functional changes. 1999-08-14 23:34:18 +00:00
oster 4ba14d22b0 Fix an 'off-by-one' error in a RF_ASSERT which meant that a reconstruct
would panic in the case where the stripe width was 1 block.
1999-08-14 21:44:24 +00:00
oster 740b9848cc Decrease the number of outstanding IO's threashold slightly.
The previous value may have been too high in some instances.
1999-08-14 03:47:07 +00:00
oster 6409e641a6 Remove a 'struct proc *'-passing abomination that's been bugging me
for quite some time.
1999-08-14 03:10:03 +00:00
oster 4a058e82c5 Correct and/or improve detection of bogus row/column values
passed in via ioctls.
1999-08-14 02:41:36 +00:00
oster db2eaf18cf rf_sys.h does not need to be #included in any of these files, and, actually,
is no longer needed at all.
1999-08-13 03:41:52 +00:00
oster 1ec5208866 This file is no longer needed. 1999-08-13 03:31:20 +00:00
oster 1aa6ce1041 Garbage collect rpcc(). 1999-08-13 03:27:46 +00:00
oster 02acd1910a First kick at cleaning up the RF_ETIMER code. New timer handling code
provided by Peter Galbavy via OpenBSD.
1999-08-13 03:26:55 +00:00
oster eca431e87c Nuke configuration of ETimer stuff during main configuration. 1999-08-13 03:25:01 +00:00
oster 5cab826918 Clean up reconstruction accounting a bit. While it worked before, it was
slightly broken in the case where the RAID set did not support reconstruction.
1999-08-13 01:43:33 +00:00
oster 33e458640f Garbage collect unused struct rf_test_acc. 1999-08-11 02:20:35 +00:00
oster 31b98d3572 When reporting the status of a component during configuration,
provide more intuitive information about whether a component is clean
or not.
1999-08-10 22:56:20 +00:00
oster 620eda50c7 Don't allow reconstructs, copybacks, or forced failures of components if
using a RAID 0, since RAID 0 can't handle those sorts of things.
1999-08-10 22:46:59 +00:00
oster 0b08c839eb Don't go ape if there is a problem verifying the parity. Note the condition
and inform the user (as opposed to panicing the system!).
1999-08-10 22:19:27 +00:00
oster 49efd10006 Oops. Make minor change that I forgot when adding the parity check ioctl. 1999-08-10 21:41:37 +00:00
oster a3aefdaee3 Add support for easily checking the parity status from userland.
Also: spl protect rf_RewriteParity().
1999-08-10 18:18:30 +00:00
oster a531d8c31e Trying to rebuild parity on a degraded set is bogus, so don't allow that.
Also, check sooner for a RAID 0 set, since rewriting parity makes no
sense there either.
1999-08-10 01:53:26 +00:00
oster e0c8203cb3 Nuke unused #define. 1999-08-03 22:07:39 +00:00
oster 5cef006d40 Need to splbio()/splx() protect some of the reconstruction stuff.
Without this, we have potentially bad interatctions with the pool
code.
1999-07-21 03:15:26 +00:00
oster ce7cb7114d rf_UnconfigureVnodes() needs to be called in the DO_RAID_FAIL macro. 1999-07-19 01:36:07 +00:00
oster 0c7600ca4e sectorsPerStripeUnit should be larger than 0. If it isn't, simply fail.
(Thanks to Thor Lancelot Simon for noting the problem).
1999-07-19 01:35:19 +00:00
oster 324c76b3d9 Once upon a time, long long ago, there was a "fix" added to the
RAIDframe driver to stop it from eating too much kernel memory when
writing data.  But that fix had a nasty side-affect of hurting write
performance (*much* more than I thought it would).  These changes nuke
that "fix", and instead put in a more reasonable mechanism for limiting
the number of simultaneous IO's which can be happening for each RAID device.
The result is a noticeable improvement in write throughput.  The End.
1999-07-08 00:45:23 +00:00
thorpej 5f1ede624f Make the kthread API a bit friendlier to loadable kernel modules. 1999-07-06 21:51:22 +00:00
oster 86abd11d42 Remember to pass down the proc pointer when adding a hot spare.
(Thanks to Martin J. Laubach for helping track this one down.)
1999-06-13 20:36:17 +00:00
oster 8c39e1bf02 When adding a hot spare, remember to lock down the main raidPtr
structure before mucking with its contents.
1999-06-04 02:02:39 +00:00
oster 60769ea563 At config time, initialize a small amount of space for the disk queues
corresponding to the hot spares.  We'll need that space when a spare is
actually added.  Huge Thanks to Martin Laubach for helping track this down.
1999-06-04 01:51:00 +00:00
oster 3af0ce9e19 Don't count two problems with a single component as two
component failures!  Also: remember to configure the disk queues for
the spares -- failure to do that is Bad(tm).
Huge Thanks to Martin Laubach for helping track this down.
1999-06-04 01:50:01 +00:00
ad daf0e5b05c Replace two instances of TNF copyright with one (was replicated for two
separate contributers).
1999-05-13 21:46:17 +00:00
oster 4882ae464f Fix a couple of compiler warnings on the Alpha. Pointed out by Tim Rightnour. 1999-04-12 19:39:59 +00:00
oster 9f560505d4 Allow re-writing parity on a RAID 0 to trivially succeed, and to set the
clean bit.  This is somewhat bogus as RAID 0 does not have any parity,
but is a slightly cleaner than other solutions, and makes the handling
of clean bits for RAID 0 consistent with the handling of clean bits at
other RAID levels.
1999-04-07 14:17:10 +00:00
oster 14de6c2418 Cleanup shutdown code - garbage collect (now) unused shutdownhooks() stuff. 1999-03-27 01:26:37 +00:00
oster efe288e520 Correct a component label problem where a RAID 1 set with a
failed component would not configure properly in certain situations.
1999-03-18 03:02:38 +00:00
oster 2ec2c2045f Cleanup rf_RewriteParity() and rf_VerifyParity(). Nuke unused stuff,
and make more readable.
1999-03-14 22:10:46 +00:00
oster 414b788837 Disallow interrupting parity re-writes or copybacks by removing PCATCH
from the tsleep()'s (they probably shouldn't have been there in the
first place!).  Making parity re-writing and copybacks interruptable
will require re-designing how a few things are done (e.g. how memory
is freed for structures shipped off to routines that run asynchronously
relative to the calling routine).  Fix a few other tsleep's while we're at it.
1999-03-14 21:53:31 +00:00
oster cd0a696176 Cleanup raidattach: move rf_boot's functionality to raidattach, and
nuke rf_boot().  Cleanup raidopen().
1999-03-09 03:53:18 +00:00
oster e39fe5e2fe Cleanup unused cruft. 1999-03-09 03:52:41 +00:00
oster 29daf0c77d rf_update_component_labels() now lives here. Re-work clean-bit
support a little: clean-bits now also get frobbed on partition
opening/closing, rather than just at device configuration and device
unconfiguration.  Schedule shutdownhooks() stuff for nukage at a later
date, since it isn't really necessary any more.
1999-03-09 02:59:25 +00:00
oster 585c77594e Move rf_update_component_labels() from here to rf_netbsdkintf.c. 1999-03-09 02:57:29 +00:00
oster 98d8c12355 Update for recent changes including component label support, clean
bits, rebuilding components in-place, adding hot spares, shutdownhooks, etc.
1999-03-02 03:18:48 +00:00
oster ee9187f136 After a vn_close(), set the vnode * to NULL so we don't try closing it
again later.
1999-02-27 03:43:20 +00:00
oster a76f56098c Do the VOP_UNLOCK() on an initialized vp, rather than random garbage. 1999-02-27 01:48:13 +00:00
oster 65be57243f Minor cleanups and code rearranging. Now knows a little about component
labels and how to deal with hot-adding spare components.  Still work in
progress -- component labels and hot-adding are not enabled (yet).
1999-02-24 00:00:03 +00:00
oster be9eca67c8 Cleanup/remove unused cruft. First kick at component labels and clean bits.
Still work in progress.  New code is there, but not enabled yet.
1999-02-23 23:57:53 +00:00
oster 07b6b89dce Move vnode cleanup code into one place. Cleanup a bit. 1999-02-23 23:55:29 +00:00
oster 0d29172def Do a VOP_UNLOCK() before a vn_close(). 1999-02-23 23:53:37 +00:00
oster 6d72c8f0e7 Minor cleanups that got missed last time through. 1999-02-11 01:23:32 +00:00
oster 0014588545 Phase 2 of the RAIDframe cleanup. The source is now closer to KNF
and is much easier to read.  No functionality changes.
1999-02-05 00:06:06 +00:00
oster 58f7de552d Nuke more bits of RAIDframe "demo" code. We're not "demoing" here,
we're doing the Real Thing!
1999-01-26 04:40:03 +00:00
oster 472e649cd8 More simulator bits going bye-bye. 1999-01-26 04:05:01 +00:00
oster c52883118d This stuff is no longer needed. Mostly simulator bits. 1999-01-26 03:56:21 +00:00
oster a37be85529 rf_ccmn.h no longer needed. Nuke it's inclusion from rf_disks.c. 1999-01-26 03:49:49 +00:00
oster d94a2c5b2a These files are not used in the kernel driver. We don't need them any more. 1999-01-26 03:07:10 +00:00
oster 1eecf8e491 RAIDframe cleanup, phase 1. Nuke simulator support, user-land driver,
out-dated comments, and other unneeded stuff.  This helps prepare
for cleaning up the rest of the code, and adding new functionality.

No functional changes to the kernel code in this commit.
1999-01-26 02:33:49 +00:00
explorer edd259d12e Make it so raidframe will only perform synchronous writes, and async
reads.  This avoids a problem where many writes will cause the driver
to allocate way too much memory.

This needs to change to a queueing system later, which will provide a
way to limit the memory consumed by the driver.

Without these changes, raidframe would use 24M or more on my machine when
the buffer cache dumped all its dirty blocks.  Now it uses around 200k
or so.
1999-01-15 17:55:52 +00:00
thorpej d8f3aefec7 Use M_RAIDFRAME. 1999-01-14 22:49:05 +00:00
oster 4128f9df1e Duh... check that malloc() hasn't returned a NULL *before* we zero the buffer,
not after. Pointed out by Michael Graff.
1999-01-14 20:29:38 +00:00
oster e392d933c8 Clean up some debugging stuff, and make it compile without warnings
with -DDEBUG on alphas.
1998-12-22 20:03:14 +00:00
oster 1b04131eff Try a bit harder to detect the physical failure of a component, and to
mark that component as dead.  Physical failures are handled much better now.
1998-12-03 15:14:40 +00:00