Commit Graph

34 Commits

Author SHA1 Message Date
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
oster 85611189b6 These changes complete the effective removal of malloc() from all
write paths within RAIDframe.  They also resolve the "panics with
RAID 5 sets with more than 3 components" issue which was present
(briefly) in the commits which were previously supposed to address
the malloc() issue.

With this new code the 5-component RAID 5 set panics are now gone.

It is also now also possible to swap to RAID 5.

The changes made are:

1) Introduce rf_AllocStripeBuffer() and rf_FreeStripeBuffer() to
allocate/free one stripe's worth of space.  rf_AllocStripeBuffer() is
used in rf_MapUnaccessedPortionOfStripe() where it is not sufficient to
allocate memory using just rf_AllocBuffer().  rf_FreeStripeBuffer() is
called from rf_FreeRaidAccDesc(), well after the DAG is finished.

2) Add a set of emergency "stripe buffers" to struct RF_Raid_s.
Arrange for their initialization in rf_Configure().  In low-memory
situations these buffers will be returned by rf_AllocStripeBuffer()
and re-populated by rf_FreeStripeBuffer().

3) Move	RF_VoidPointerListElem_t *iobufs from the dagHeader into
into struct RF_RaidAccessDesc_s.  This is more consistent with the
original code, and will not result in items being freed "too early".

4) Add a RF_RaidAccessDesc_t *desc to RF_DagHeader_s so that we have a
way to find desc->iobufs.

5) Arrange for desc in the DagHeader to be initialized in InitHdrNode().

6) Don't cleanup iobufs in rf_FreeDAG() -- the freeing is now delayed
until rf_FreeRaidAccDesc() (which is how the original code handled the
allocList, and for which there seem to be some subtle, undocumented
assumptions).

7) Rename rf_AllocBuffer2() to be rf_AllocBuffer() and remove the
former rf_AllocBuffer().  Fix all callers of rf_AllocBuffer().
(This was how it was *supposed* to be after the last time these
changes were made, before they were backed out).

8) Remove RF_IOBufHeader and all references to it.

9) Remove desc->cleanupList and all references to it.

Fixes PR#20191
2004-04-09 23:10:16 +00:00
oster 0ff2145648 For each RAID set, pre-allocate a number of "emergency buffers" to be
used in the event that we can't malloc a buffer of the appropriate
size in the traditional way.  rf_AllocIOBuffer() and rf_FreeIOBuffer()
deal with allocating/freeing these structures.  These buffers are
stored in a list on the 'iobuf' list.  iobuf_count keeps track of how
many buffers are available, and numEmergencyBuffers is the effective
"high-water" mark for the freelist.  The buffers allocated by
rf_AllocIOBuffer() are stripe-unit sized, which is the maximum
size requested by any of the callers.

Add an iobufs entry to RF_DagHeader_s.  Use it for keeping track of
buffers that get allocated from the free-list.

Add a "generic list" pool (VoidPointerListElement Pool) for elements
used to maintain a list of allocated memory.  [It is somewhat less
than ideal to add another little pool to handle this...]

Teach rf_AllocBuffer() to use the new rf_AllocIOBuffer().  Modify
other Mallocs to use rf_AllocIOBuffer(), and to update dag_h->iobufs as
appropriate.

Update rf_FreeDAG() to handle cleanup of dag_h->iobufs.

While here, add some missing pool_destroy() calls for a number of pools.

With these changes, it should (in theory) be possible to swap on
RAID 5 sets again.  That said, I've not had any success there yet --
but the last issue I saw at least wasn't in RAIDframe. :-}

[There is room for this code to become a bit more consise, but I
wanted to do a checkpoint here with something known to work :) ]
2004-03-20 04:22:05 +00:00
oster 29c6e63ebb dag_node_pool never did get used here. Turf. 2004-03-19 17:04:35 +00:00
oster 8150ff6fbd - don't use rf_PrintUserStats() for recon statistics.
rf_PrintUserStats() was mean for the simulator, and doesn't provide
any real info in kernel-space, especially for reconstructs.
Reconstructing actually renders the stats even more useless, since it
resets them all to zero before the reconstruct starts!

 - since rf_PrintUserStats() is no longer used, nuke it along with the
routines that feed it.  Nothing was using this code, and if we ever
need it again, we know where to find it.
2004-03-13 02:00:15 +00:00
oster bce42a3095 Move pss_pool to rf_pools. Will save a bit of extra memory at
run-time, and we can only do one reconstruction at a time anyway.
Nuke pss_issued_pool - move it to an internal structure in pss.
2004-03-08 02:25:27 +00:00
oster 8cbd53826e A few more cleanups missed in last commit. 2004-03-08 01:59:26 +00:00
oster acce07be62 Minor cleanup. No functional change. 2004-03-08 01:55:14 +00:00
oster c7eaad6a14 Use RF_ACC_TRACE to #if out more chunks of code related only
to access tracing.  (not turned on yet)
2004-03-01 23:30:57 +00:00
oster 2e19186660 iCleanup the RF_CREATE_PARAM3(). Middle two "arguments" were nothing
but 0 in all cases.
2004-01-10 00:56:27 +00:00
oster 181f2eebee remove terminate_disk_queues from RF_Raid_s. The hist_diskreq[]
stuff is only used for the CHAINDECLUSTERING, so hide it with an #if.
2004-01-05 01:19:07 +00:00
oster d3aa064253 Nuke a bunch of unused variables:
- node_queue_cond
 - quiescent_cond
 - eq_cond
 - desc->cond
 - desc->head
 - diskqueue->numWaiting

Nuke rf_print_unable_to_init_cond().
Nuke rf_TerminateDiskQueues prototype from rf_diskqueue.h.
2004-01-01 19:27:35 +00:00
oster dd05ba5c10 sparediskids isn't used anywhere. turf. 2003-12-30 22:56:40 +00:00
oster e276d553e6 Garbage-collect a whole mess of this RF_THREADGROUP_* stuff that isn't
being used.  Then, nuke rf_init_managed_threadgroup() and all
descendants and relations.
2003-12-29 06:19:28 +00:00
oster 8b09b35f45 Let's see... raidPtr->recon_done_procs is never set to anything
(other than NULL when raidPtr is initialized).  That means
SignalReconDone() never does anything useful.  Bye-bye!

Say good-bye to recon_done_procs and recon_done_procs_mutex (and its
initializer) as well.
2003-12-29 05:58:34 +00:00
oster 10f077a0fb [Having received a definite lack of strenuous objection, a small amount
of strenuous agreement, and some general agreement, this commit is
going ahead because it's now starting to block some other changes I
wish to make.]

Remove most of the support for the concept of "rows" from RAIDframe.
While the "row" interface has been exported to the world, RAIDframe
internals have really only supported a single row, even though they
have feigned support of multiple rows.

Nothing changes in configuration land -- config files still need to
specify a single row, etc.  All auto-config structures remain fully
forward/backwards compatible.

The only visible difference to the average user should be a
reduction in the size of a GENERIC kernel (i386) by 4.5K.  For those
of us trolling through RAIDframe kernel code, a lot of the driver
configuration code has become a LOT easier to read.
2003-12-29 02:38:17 +00:00
jdolecek e3c5d7b092 constify some 2003-02-09 10:04:32 +00:00
oster 08933e5968 Better protect hot-spare adding, and make it LOCKDEBUG friendly. 2002-10-22 03:15:28 +00:00
oster 9401ec32c0 poolify the allocation of Parity Stripe Status structures.
XXX: Current code may have problems if kernel memory is completely depleted.
This is, unfortunately, not the only chunk of RAIDframe code to have
this problem, and will have to be dealt with. :(
2002-10-11 02:10:08 +00:00
oster 8bdc70d040 As part of the effort to get RAIDframe playing nicely with LOCKDEBUG,
rework how completed requests are handled.  In particular, instead of
doing all sorts of work and locking in interrupt context, completed
requests are now queued.  A new kernel thread (rf_RaidIOThread) now
handles calling rf_DiskIOComplete() and (req->CompleteFunc)() for each
completed request.  There is still work to be done to make RAIDframe
LOCKDEBUG friendly, but this change is a huge step forward.

Reviewed by (and many thanks to): thorpej
2002-10-04 20:05:14 +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 d7a81df519 RF_DEV2RAIDID isn't used anywhere anymore. Bye bye. 2001-09-26 03:01:19 +00:00
oster aea97a5a17 Oops... Missed commmitting this last night. Thanks to Matthias Scheler
for letting me know.
(Add the DiskQueueSW pointer)
2000-02-24 17:12:10 +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 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 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 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 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 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
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 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 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