summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/rf_reconstruct.c
AgeCommit message (Collapse)Author
2009-11-17Finally commit the RAIDframe parity map Summer Of Code project.jld
Drastically reduces the amount of time spent rewriting parity after an unclean shutdown by keeping better track of which regions might have had outstanding writes. Enabled by default; can be disabled on a per-set basis, or tuned, with the new raidctl(8) commands. Discussed on tech-kern@ to a general air of approval; exhortations to commit from mrg@, christos@, and others. Thanks to Google for their sponsorship, oster@ for mentoring the project, assorted developers for trying very hard to break it, and probably more I'm forgetting.
2009-02-11If we see a RF_RECON_WRITE_ERROR event we know a write has finished andoster
we need to account for that. Failure to do so means we can end up waiting forever for writes we think are outstanding, but which have already completed. Addresses the RAIDframe part of PR#40569. Thanks to Matthias Scheler for reporting the issue and verifying the fix.
2008-12-20When unconfiguring an array where a reconstruct is in progress, abortoster
the reconstruct and wait for IOs to drain before pulling the plug. Should fix the panic reported by der Mouse on tech-kern.
2008-09-23Nuke unneeded printf(). Spotted by pooka@.oster
2008-05-19Re-work some of the guts of the reconstruction code.oster
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.
2008-04-15A forced recon read should not default to indicating that the readsoster
for that disk have stopped, since this will bump us out of the normal reconstruction loop prematurely. Fixes the (mostly cosmetic) bug where the reconstruction status values stop updating, and from raidctl it appears that reconstruction has totally stalled (which it actually hasn't -- the reconstruction does complete properly, but not in the normal way).
2008-04-14Print out the status value if a reconstruction read fails.oster
Don't print out write promotions during reconstruct unless we are debugging reconstructs.
2008-01-26In a land before time, when kernel processes roamed the system, weoster
needed to keep track of the kernel process that opened a device in order to close it with the right credentials. Flash forward to today where curlwp is now quite sufficient.
2007-11-26Remove the "struct lwp *" argument from all VFS and VOP interfaces.pooka
The general trend is to remove it from all kernel interfaces and this is a start. In case the calling lwp is desired, curlwp should be used. quick consensus on tech-kern
2007-09-21Fix wording in a comment and correct a debug line. From Olivier Cherrieroster
(via private mail). Thanks!
2007-07-18Fix fallout from recent kthread changes.ad
2007-07-09Merge some of the less invasive changes from the vmlocking branch:ad
- kthread, callout, devsw API changes - select()/poll() improvements - miscellaneous MT safety improvements
2007-06-26Change dk_lookup() to accept an additional argument of the type enum uio_segcube
that tells whether the given path is in user space or kernel space, so it can tell NDINIT(). While the raidframe calls were ok, both ccd(4) and cgd(4) were passing pointers to user space data, which leads to strange error on i386, as reported by Jukka Salmi on current-users. The issue has been there since last august, I'm actually a bit surprised that no one in the meantime has used ccd(4) or cgd(4) on an arch where it would have simply faulted.
2006-11-16__unused removal on arguments; approved by core.christos
2006-10-12- sprinkle __unused on function decls.christos
- fix a couple of unused bugs - no more -Wno-unused for i386
2006-08-27- use dk_lookup instead of our home-spun version.christos
- allow raid to be configured in a wedge - allow wedges to be configured in a raid - add autoconfiguration of wedges in a raid
2006-07-21- Use the LWP cached credentials where sane.ad
- Minor cosmetic changes.
2006-05-14integrate kauth.elad
2005-12-11merge ktrace-lwp.christos
2005-07-18If rf_SubmitReconBuffer indicates the submission was blocked (foroster
whatever reason), return 0 instead of the default RF_RECON_READ_STOPPED. Returning RF_RECON_READ_STOPPED would result in rf_ContinueReconstructFailedDisk() thinking that the given component was "done" and breaking out of the main reconstruction loop far too early. Reconstruction still worked correctly as long as there were no errors, but RAIDframe wouldn't be in a position to properly handle read/write errors during reconstruction. This fixes the "raidctl's progress bar spins at 0% until reconstruction finishes" problem.
2005-06-08- initialize numRUsTotal before we indicate that we are doing a reconstruct.oster
- make numRUsComplete and numRUsTotal 64-bit quantities like everything else that records this information.
2005-02-27nuke trailing whitespaceperry
2005-02-12The 'next' argument to rf_CreateDiskQueueData is always NULL. Sinceoster
there is no particular reason to pass an extra NULL argument, turf it, and initialize p->next to NULL within the function.
2005-02-12Add a 'waitflag' argument to rf_CreateDiskQueueData() and use it tooster
determine if we are willing to wait for memory to come from the diskqueuedata (dqd) and bufpool pools. Cleanup the mess related to code calling rf_CreateDiskQueueData() with different expectations (and/or blatent disregard) of what might happen if there were insufficient pool resources.
2005-02-06It's not a bad idea to update the component labels whether or not theoster
reconstruction was successful.
2005-02-05rf_GetNextReconEvent() *will* return a valid event, so no need foroster
the assert. (we'd have panic'ed in there long before this assert if that wasn't the case). Minor whitespace changes.
2005-02-05Vastly improve the error handling in the case of a read/write erroroster
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.
2005-01-22Torch some #define's missed in last commit.oster
2005-01-22Reconstruction Descriptors are only allocated once per reconstruction,oster
and don't need their own pool or freelist or anything fancier than a malloc/free.
2005-01-18ForceReconReadDoneProc() needs a return after doing the firstoster
rf_CauseReconEvent().
2004-12-12The switch() in rf_ContinueReconstructFailedDisk() is never actuallyoster
used in non-simulation code, and thus is just wasting space (and making the code more confusing to read!). Turf the switch, left-shift the indentation of code, and nuke 'state' field of struct RF_RaidReconDesc_s. No real functional changes.
2004-11-15continueFunc and continueArg arn't used. Turf. Simplify calls tooster
rf_GetNextReconEvent().
2004-03-18Re-work the locking mechanisms for reconstruct and PSS structuresoster
such that we don't actually hold a simplelock while we are doing a pool_get(), but that we still effectively protecting critical code. This should fix all of the outstanding LOCKDEBUG warnings related to rebuilding RAID sets.
2004-03-13 - don't use rf_PrintUserStats() for recon statistics.oster
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-07- Introduce rf_pools which contains all of the various global pools usedoster
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)
2004-03-07- fix up initialization of rf_recond_pooloster
- introduce rf_reconbuffer_pool and teach rf_MakeReconBuffer() to use it
2004-03-05Use RF_INCLUDE_PARITY_DECLUSTERING_DS to #if-out more unneeded bits.oster
(We can't do RF_DISTRIBUTE_SPARE bits without the parity declustering stuff.)
2004-03-03Nuke some unnecessary casts. No functional changes.oster
2004-03-03Introduce RF_REVENT_READ_FAILED, RF_REVENT_WRITE_FAILED and ↵oster
RF_REVENT_FORCEREAD_FAILED. This removes 3 more RF_PANIC()'s (but we'll currently still panic if any of these cases occur). fix up a few printf's. XXX: still needs more cleanup and testing (and be taught to not panic).
2004-03-03Cleanup function prototypes.oster
2004-03-03- cleanup memory allocation in rf_AllocPSStatus()oster
- change function signature of rf_LookupRUStatus(). The last argument is now a pointer to a new PSS, in case one is needed. Rather than having rf_LookupRUStatus() allocate a new PSS, we pre-allocate one beforehand, where necessary, just in case. - change callers of rf_lookupRUStatus() to deal with the new way of calling rf_lookupRUStatus(). [no improvement or worsening of parity rebuild/initialization performance.]
2004-03-01Use RF_ACC_TRACE to #if out more chunks of code related onlyoster
to access tracing. (not turned on yet)
2004-02-29Adjust _rf_ShutdownCreate() so that it is willing to wait for moreoster
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.
2004-01-04raidPtr->reconControl->percentCompleted only gets used in oneoster
debugging printf, and in rf_netbsdkintf.c. We can do the calculations inside of RF_DEBUG_RECON for the one debugging printf, and only perform the percentCompleted calculation "on demand" in the rf_netbsdkintf.c case. Shaves a few more bytes off an i386 GENERIC kernel, and ever-so-slightly decreases the amount of work performed during a reconstruct.
2003-12-31Add in a bunch of RF_SIGNAL_COND()'s that were missing. Tidy uposter
a few lines.
2003-12-31Left-shift another else{} chunk. No functional changes.oster
2003-12-31left-shift the "else" part of the if(!lp_SubmitReconBuffer) condition.oster
Cleanup. No real functional changes, just more readable.
2003-12-31Negate a condition, and flip if/else parts. Preparation for left-shiftingoster
the (now) else part. No real functional change.
2003-12-30Some days you wonder if some of the function declaration consistencyoster
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-29Let's see... raidPtr->recon_done_procs is never set to anythingoster
(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.