Commit Graph

16 Commits

Author SHA1 Message Date
oster 87e6ffb752 As noted by Thierry Deval in a posting to misc/at/openbsd.org,
rf_DecrAccessesCountState wasn't in the correct spot in
RF_AccessState_e.  Following up on that has resulted in one other
correction.  Changing orderings of these states is tricky, and
shouldn't be attempted without some thorough analysis.  For the
changes committed, the following analysis is offerred:

1) RAIDframe uses a little state machine to take care of building,
executing, and processing the DAGs used to direct IO.

2) The rf_DecrAccessesCountState state is handled by the function
rf_State_DecrAccessCount().  The purpose of this state is to
decrement the number of "accesses-in-flight".

3) rf_Cleanup_State is handled by rf_State_Cleanup().  Its job is to
do general cleanup of DAG arrays and any stripe locks.

4) DefaultStates[] in rf_layout.c indicates that the right spot
for rf_DecrAccessesCountState is just before rf_Cleanup_State.
Analysis of code for both states indicates that the order doesn't
matter too much, although rf_State_DecrAccessCount() should probably
take place *after* rf_State_Cleanup() to be more correct.

5) Comments in rf_State_ProcessDAG() indicates that the next state
should be rf_Cleanup_State.  However: it attempts to get there by using

 desc->state++;

which actually takes it to just rf_DecrAccessesCountState! This turned
out to be OK before, since rf_Cleanup_State would follow right after,
and all would be taken careof (albeit in arguably the "less correct"
order).

6) With the current ordering, if we head directly to rf_Cleanup_State
(as we do, for example, if multiple components fail in a RAID 5 set),
then we'll actually miss going trough rf_DecrAccessesCountState), and
could end up never being able to reach quiescence!  Perhaps not too
big of a deal, given that the RAID set is pretty much toast by that
point at which such a drastic state change happens, but might as well
have this correct.

The changes made are:
1) Since having rf_State_DecrAccessCount() come after
rf_State_Cleanup() is just fine, change rf_layout.c to reflect that
rf_DecrAccessesCountState comes after rf_Cleanup_State (i.e. they swap
positions in the state list).  This means that going to
rf_Cleanup_State after bailing on a failed DAG access will do all the
right things -- the state will get cleaned up, and then the access
counts will get decremented properly.  The comment in
rf_State_ProcessDAG() is now actually correct -- the next state *will*
be rf_Cleanup_State.

2) Move rf_DecrAccessesCountState in RF_AccessState_e to just after
rf_CleanupState.  This puts RF_AccessState_e in sync with
DefaultStates[].  Fortunately, these states are rarely referred to by
name, and so this change ends up being mostly cosmetic -- it really
only fixes cleanup behaviour for the recent "Failed to create a DAG"
changes.
2004-01-04 06:37:16 +00:00
oster c43fc67d7d Some days you wonder if some of the function declaration consistency
was just an accident in the first place.  Cleanup function decls and
a few comments.  [ok.. so I wasn't going to fix this many.. but once
you're on a roll....]
2003-12-30 21:59:03 +00:00
jdolecek e3c5d7b092 constify some 2003-02-09 10:04:32 +00:00
oster 35d3621d0c dataBytesPerStripe is set, but never used. *poof* 2002-09-23 02:35:24 +00:00
oster 35940367a4 Cleanup configuration and auto-configuration information printing.
Thanks to mrg for the suggestions.
2002-08-03 00:55:54 +00:00
lukem a3746e00b7 add RCSIDs 2001-11-13 07:11:12 +00:00
oster 765e00d3de Step 2 of the disentanglement. We now look to <dev/raidframe/*> for
the stuff that used to live in rf_types.h, rf_raidframe.h, rf_layout.h,
rf_netbsd.h, rf_raid.h, rf_decluster,h, and a few other places.
Believe it or not, when this is all done, things will be cleaner.

No functional changes to RAIDframe.
2001-10-04 15:58:51 +00:00
oster 75ea8b428e Having moved some of the bits needed by raidctl into rf_configure.c, we
no longer need those bits here.  In particular, this file is now only
used in the kernel, and that allows us to clean up a lot of cruft.
2001-01-27 19:34:43 +00:00
oster 3edd34f0be More #if's. This needs some serious rototillage, but a few #if's will
suffice for now.
2001-01-27 02:13:34 +00:00
oster a40eef11ac Give the parity declustering code their own 'RAID arch' types, and
allow us to turn them off if desired.
2001-01-26 04:40:03 +00:00
oster 5845348e54 Revert last change (the last change was not necessarily desirable, and
had some other minor side-affects that were troublesome).
2000-04-17 19:35:12 +00:00
oster c71398f7a9 Don't allow configuration where the specified SectPerSU may result in IO larger
than MAXPHYS being sent to underlying devices.  Addresses PR#9868.
Will change if/when MAXPHYS goes bye-bye.
2000-04-16 03:24:26 +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 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 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
oster 38a3987b69 RAIDframe, version 1.1, from the Parallel Data Laboratory at
Carnegie Mellon University.  Full RAID implementation, including
levels 0, 1, 4, 5, 6, parity logging, and a few other goodies.
Ported to NetBSD by Greg Oster.
1998-11-13 04:20:26 +00:00