Home | History | Annotate | Download | only in raidframe
History log of /src/sys/dev/raidframe/rf_revent.c
RevisionDateAuthorComments
 1.29  23-Jul-2021  oster Extensive mechanical changes to the pools used in RAIDframe.

Alloclist remains not per-RAID, so initialize that pool
separately/differently than the rest.

The remainder of pools in RF_Pools_s are now per-RAID pools. Mostly
mechanical changes to functions to allocate/destroy per-RAID pools.
Needed to make raidPtr available in certain cases to be able to find
the per-RAID pools.

Extend rf_pool_init() to now populate a per-RAID wchan value that is
unique to each pool for a given RAID device.

TODO: Complete the analysis of the minimum number of items that are
required for each pool to allow IO to progress (i.e. so that a request
for pool resources can always be satisfied), and dynamically scale
minimum pool sizes based on RAID configuration.
 1.28  02-May-2011  mrg branches: 1.28.74;
re-apply the reverted previous, after fixing the missed wakeup:

convert eq_mutex to a kmutex/cv.
convert ltsleep() used for plain timeout into kpause().
 1.27  02-May-2011  mrg rever the previous for now; it hangs reconstruction.
 1.26  01-May-2011  mrg convert eq_mutex to a kmutex.
convert ltsleep() used for plain timeout into kpause().
 1.25  19-May-2008  oster branches: 1.25.20; 1.25.26;
Re-work some of the guts of the reconstruction code.

Reconmap used to have one pointer for every reconstruction unit. This
does not scale well in the land of 1TB disks, where some 100MB+ of
"status pointers" are required for typical configurations. Convert
the reconstruction code to use a "sliding status window" which will
scale nicely regardless of the number of stripes/reconstruction units
in the RAID set. Convert the main reconstruction loop to rebuild the
array in chunks rather than in one big lump.

As part of these changes, introduce a function to kick any waiters on
the head separation callback list, and use that in the main
reconstruction event queue to wake up the waiters if things have
stalled. (I believe this may fix a race condition that could occur at
at least at the very end of a disk during reconstruction under heavy
IO load.)

Thanks to Brian Buhrow for all his help, support, and patience in
testing these changes.
 1.24  16-Nov-2006  christos branches: 1.24.2; 1.24.16; 1.24.48; 1.24.50; 1.24.52; 1.24.54;
__unused removal on arguments; approved by core.
 1.23  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.22  11-Dec-2005  christos branches: 1.22.20; 1.22.22;
merge ktrace-lwp.
 1.21  27-Feb-2005  perry branches: 1.21.2;
nuke trailing whitespace
 1.20  05-Feb-2005  oster Vastly improve the error handling in the case of a read/write error
that occurs during a reconstruction. We go from zero error handling
and likely panicing if something goes amiss, to gracefully bailing and
leaving the system in the best, usable state possible.

- introduce rf_DrainReconEventQueue() to allow easy cleaning of the
reconstruction event queue

- change how we cleanup the floating recon buffers in
rf_FreeReconControl(). Detect the end of the list rather
than traversing according to a count.

- keep track of the number of pending reconstruction writes. In the
event of a read error, use this to wait long enough for the pending
writes to (hopefully) drain.

- more cleanup is still needed on this code, but I didn't want to
start mixing major functional changes with minor cleanups.

XXX: There is a known issue with pool items left outstanding due to
the IO failure, and this can show up in the form of a panic at the
tail end of a shutdown. This problem is much less severe than before
these changes, and the hope/plan is that this problem will go away
once this code gets overhauled again.
 1.19  15-Nov-2004  oster branches: 1.19.4; 1.19.6;
continueFunc and continueArg arn't used. Turf. Simplify calls to
rf_GetNextReconEvent().
 1.18  07-Mar-2004  oster - Introduce rf_pools which contains all of the various global pools used
by RAIDframe. Convert all other RAIDframe global pools to use pools
defined within this new structure.
- Introduce rf_pool_init(), used for initializing a single pool in
RAIDframe. Teach each of the configuration routines to use
rf_pool_init().
- Cleanup a few pool-related comments.
- Cleanup revent initialization and #defines.
- Add a missing pool_destroy() for the reconbuffer pool.

(Saves another 1K off of an i386 GENERIC kernel, and makes
stuff a lot more readable)
 1.17  02-Mar-2004  oster DO_WAIT and DO_SIGNAL macros are a bit much, as they are only each used
in one place. Simplify things a bit. No functional change.
 1.16  02-Mar-2004  oster We're willing to wait, so we should always get something valid from
pool_get().
 1.15  29-Feb-2004  oster Adjust _rf_ShutdownCreate() so that it is willing to wait for more
memory. Since we only now ever "return(0)", just return (void)
instead.

Cleanup all uses of rf_ShutdownCreate() to not worry about
it ever failing. Shaves another 600 bytes off of an i386 GENERIC kernel.
 1.14  30-Dec-2003  oster 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....]
 1.13  29-Dec-2003  oster - first kick at a major reworking of RAIDframe's memory allocation code:
- all freelists converted to pools
- initialization of structure members in certain cases where
code was relying on specific allocation and usage properties
to keep structures in a "known state" (that doesn't work with
pools!).
- make most pool_get() be "PR_WAITOK" until they can be analyzed
further, and/or have proper error handling added.
- all RF_Mallocs zero the space returned, so there is no difference
between RF_Calloc and RF_Malloc. In fact, all the RF_Calloc()'s
do is tend to do is get things horribly confused.
Make RF_Malloc() the "general memory allocator", with
RF_MallocAndAdd() the "general memory allocator with
allocation list".
- some of these RF_Malloc's et al. are destined to disappear.
- remove rf_rdp_freelist entirely (it's not used anywhere!)
- remove: #include "rf_freelist.h"
- to the files that were relying on the above, add: #include "rf_general.h"
- add: #include "rf_debugMem.h" to rf_shutdown.h to make it happy
about the loss of: #include "rf_freelist.h".

This shrinks an i386 GENERIC kernel by approx 5K. RAIDframe now
weighs in at about 162K on i386.
 1.12  29-Dec-2003  oster [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.
 1.11  14-Sep-2002  oster branches: 1.11.6;
Everyone and their dog was using RF_ERRORMSG3 to print out the same
sort of error message, over and over again, in different files.
Rather than having the same text repeated in multiple .o files,
create a couple of little functions to do the printing, and save a
bundle of space. Also improves readability of code.
 1.10  13-Nov-2001  lukem add RCSIDs
 1.9  21-Sep-2000  oster branches: 1.9.2; 1.9.4;
convert tsleep()->ltsleep(), which makes the kernel complain less
when compiled with LOCKDEBUG.
 1.8  11-Sep-2000  oster Only reset the timer value if it actually accumlated time.
Otherwise it may never accumulate any time, and the recon delay
will never happen.
 1.7  30-May-2000  oster branches: 1.7.2;
Use #include <sys/kernel.h> instead of a 'extern int hz'.
Make this file more readable.
 1.6  07-Jan-2000  oster branches: 1.6.2;
rf_GetNextReconEvent() is already prototyped in rf_revent.h.
minor cleanup
 1.5  13-Aug-1999  oster branches: 1.5.2;
First kick at cleaning up the RF_ETIMER code. New timer handling code
provided by Peter Galbavy via OpenBSD.
 1.4  14-Mar-1999  oster 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.
 1.3  05-Feb-1999  oster Phase 2 of the RAIDframe cleanup. The source is now closer to KNF
and is much easier to read. No functionality changes.
 1.2  26-Jan-1999  oster 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.
 1.1  13-Nov-1998  oster 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.
 1.5.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.7.2.2  17-Oct-2000  tv Pullup 1.9 [oster]:
convert tsleep()->ltsleep(), which makes the kernel complain less
when compiled with LOCKDEBUG.
 1.7.2.1  17-Oct-2000  tv Pullup 1.8 [oster]:
Only reset the timer value if it actually accumlated time.
Otherwise it may never accumulate any time, and the recon delay
will never happen.
 1.9.4.2  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.9.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.2  17-Sep-2002  nathanw Catch up to -current.
 1.9.2.1  14-Nov-2001  nathanw Catch up to -current.
 1.11.6.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.11.6.5  06-Feb-2005  skrll Sync with HEAD.
 1.11.6.4  29-Nov-2004  skrll Sync with HEAD.
 1.11.6.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.6.2  18-Sep-2004  skrll Sync with HEAD.
 1.11.6.1  03-Aug-2004  skrll Sync with HEAD
 1.19.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.19.6.1  12-Feb-2005  yamt sync with head.
 1.19.4.1  29-Apr-2005  kent sync with -current
 1.21.2.1  25-May-2008  bouyer Pull up following revision(s) (requested by oster in ticket #1933):
sys/dev/raidframe/rf_reconmap.h: revision 1.11
sys/dev/raidframe/rf_reconmap.c: revision 1.31
sys/dev/raidframe/rf_reconstruct.h: revision 1.24
sys/dev/raidframe/rf_reconstruct.c: revision 1.104
sys/dev/raidframe/rf_revent.c: revision 1.25
Convert the reconstruction code to use a "sliding status window" which will
scale nicely regardless of the number of stripes/reconstruction units
in the RAID set. Convert the main reconstruction loop to rebuild the
array in chunks rather than in one big lump. May fix bin/38471.
 1.22.22.2  10-Dec-2006  yamt sync with head.
 1.22.22.1  22-Oct-2006  yamt sync with head
 1.22.20.1  18-Nov-2006  ad Sync with head.
 1.24.54.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.24.52.1  04-May-2009  yamt sync with head.
 1.24.50.1  04-Jun-2008  yamt sync with head
 1.24.48.1  02-Jun-2008  mjf Sync with HEAD.
 1.24.16.1  03-Jun-2008  skrll Sync with netbsd-4.
 1.24.2.1  25-May-2008  bouyer Pull up following revision(s) (requested by oster in ticket #1153):
sys/dev/raidframe/rf_reconmap.h: revision 1.11
sys/dev/raidframe/rf_reconmap.c: revision 1.31
sys/dev/raidframe/rf_reconstruct.h: revision 1.24
sys/dev/raidframe/rf_reconstruct.c: revision 1.104
sys/dev/raidframe/rf_revent.c: revision 1.25
Convert the reconstruction code to use a "sliding status window" which will
scale nicely regardless of the number of stripes/reconstruction units
in the RAID set. Convert the main reconstruction loop to rebuild the
array in chunks rather than in one big lump. May fix bin/38471.
 1.25.26.1  06-Jun-2011  jruoho Sync with HEAD.
 1.25.20.1  31-May-2011  rmind sync with head
 1.28.74.1  01-Aug-2021  thorpej Sync with HEAD.

RSS XML Feed