summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/rf_engine.c
AgeCommit message (Collapse)Author
2016-12-11Ensure variables are initialized. Fixes error due to -Wmaybe-unitialized.nat
2016-01-03refactor driver to use common code in dksubr.mlelstv
2014-10-18src is too big these days to tolerate superfluous apostrophes. It'ssnj
"its", people!
2013-09-15ifdef variables like their usemartin
2013-04-27allocate devices dynamically.christos
2011-09-07Newline is \n, not /n.mbalmer
2011-05-11convert the main raidPtr mutex to a kmutex, and add a couple of cv's tomrg
cover the old sleep/wakeup points for adding_hot_spare and waitForReconCond. convert all remaining simple_lock's to kmutexes (they're not used or compiled right now... even with all options enabled) and remove the support for them. this leaves just a pair of tsleep()/wakeup() calls using old scheduling APIs.
2011-05-02use a unique wchan identifier for node_queue_cv than the old default.mrg
2011-04-27prepare to convert more raidframe old lock/sleep APIs to mutex/condvar:mrg
- remove RF_DECLARE_EXTERN_MUTEX and RF_DECLARE_STATIC_MUTEX, the qualifier can be provided at the use point with the normal define - rename the *LGMGR_MUTEX() macros to *mutex2() names, and add some more defines for use: rf_declare_mutex2() rf_declare_cond2() rf_lock_mutex2() rf_unlock_mutex2() rf_init_mutex2() rf_destroy_mutex2() rf_init_cond2() rf_destroy_cond2() rf_wait_cond2() rf_signal_cond2() rf_broadcast_cond2() - use the new names for the configureMutex(), which previous used some combo of direct mutex* calls and macros - convert the node_queue to use a mutex/cv combo - in rf_ShutdownEngine() and DAGExecutionThread(), also signal the former from the latter when it is done and about to exit - convert iodone_lock to use the new macros
2011-04-23move the iodone setup and tear down into rf_engine.c. this fixesmrg
"raidctl -u" and should also help the case where we fail to setup a device part of the way through.
2011-04-23convert the iodone_lock to a mutex, and use a condvar for signalling.mrg
this only handles the smallest use of old simple_lock/tsleep/wakeup APIs inside raidframe, and it points out that cv(9)'s have only one wait channel per cv, whereas each tsleep() caller can specify a different wait channel. this change removes the difference between normal raidio and waiting for IO during shutdown. i've tested this one 3 systems, ran atf, and had mlelstv and rmind review the change.
2010-09-13comment out an unused static functiondrochner
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.
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
2005-12-11merge ktrace-lwp.christos
2005-09-25Re-work the handling of incoming I/O in RAIDframe:oster
- introduce rf_buf_queue_check() which checks to see if there is work to do in the incoming buffer queue - rf_RaidIOThread() is now responsible for calling raidstart(), and is also now the only place that calls raidstart() - raidstrategy() now just queues requests in buf_queue and signals rf_RaidIOThread() that work has arrived Hopefully addresses PR#30233
2005-02-27nuke trailing whitespaceperry
2004-03-09Introduce RF_DEBUG_ENGINE and use it to disable a number of debuggingoster
bits in rf_engine.c
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-02Fix the "We panic if we can't create a DAG" problem that's existedoster
~forever. This requires a number of things: 1) If we can't create a DAG, set desc->numStripes to 0 in rf_SelectAlgorithm. This will ensure that we don't attempt to free any dagArray[] elements in rf_StateCleanup. 2) Modify rf_State_CreateDAG() to not panic in the event of a DAG failure. Instead, set the bp->b_flags and bp->b_error, and set things up to skip to rf_State_Cleanup(). 3) Need to mark desc->status as "bad" so that we actually stop looking for a different DAG. (which we won't find... no matter how many times we try). 4) rf_State_LastState() will then do the biodone(), and return EIO for the IO in question. 5) Remove some " || 1 "'s from ProcessNode(). These were for debugging, and we don't need the failure notices spewing over and over again as the failing DAGs are processed. 6) Needed to change if (asmap->numDataFailed + asmap->numParityFailed > 1) to if ((asmap->numDataFailed + asmap->numParityFailed > 1) || (raidPtr->numFailures > 1)){ in rf_raid5.c so that it doesn't try to return rf_CreateNonRedundantWriteDAG as the creation function. 7) Note that we can't apply the above change to the RAID 1 code as with the silly "fake 2-D" RAID 1 sets, it is possible to have 2 failed components in the RAID 1 set, and that would stop them from working. (I really don't know why/how those "fake 2-D" RAID 1 sets even work with all the "single-fault" assumptions present in the rest of the code.) 8) Needed to protect rf_RAID0DagSelect() in a similar way -- it should return NULL as the createFunc. 9) No point printing out "Multiple disks failed..." a zillion times.
2004-01-01Nuke a bunch of unused variables:oster
- 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.
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-29Garbage-collect a whole mess of this RF_THREADGROUP_* stuff that isn'toster
being used. Then, nuke rf_init_managed_threadgroup() and all descendants and relations.
2003-12-29_rf_create_managed_cond() is now left doing nothing. Convert callers.oster
Mash DO_RAID_COND in rf_driver.c out of existance. - Nuke (already #if 0'ed) _rf_create_managed_lkmgr_mutex() while we're busy here. simplify DO_INIT in rf_engine.c
2003-12-29_rf_create_managed_mutex() is doing just a simple:oster
rf_mutex_init(m) now. The rest of the fluff is no longer needed. It also cannot fail, so error checking on rf_create_managed_mutex() is just wasting space. Nuke the #define's associated with rf_create_managed_mutex(). Convert rf_create_managed_mutex(listp,m) to just rf_mutex_init(m). Remove wasteful "error checking" and simplify all instances where this is called. (another 0.3K saved in the binary, but the real savings is in code readability!)
2002-10-04Clean up #includes. Group function prototypes. Fix more 80-column lossageoster
that was missed before. Cleanup a printf.
2002-10-04Undo the change from 1.16->1.17, and 1.19->1.20. The ltsleep and lockingoster
that was there before before is just fine, and plays nicely with LOCKDEBUG now that we've added the raidio thread.
2002-10-04Tidy up comments and do some 80-column fixing. No functional changes.oster
2002-10-04As part of the effort to get RAIDframe playing nicely with LOCKDEBUG,oster
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-02Create a thread creation macro that make it easier to name the DAG process.oster
Use it to have the DAGExecutionThread have a better name for each RAID process ('raid0', 'raid1', etc., vs. just 'raid', 'raid', etc.)
2002-10-02Since we are unlocking the lock before sleeping, there is no needoster
to use ltsleep() when a tsleep() will suffice. Makes RAIDframe+LOCKDEBUG play together much better.
2002-09-23Nuke a couple of unreached 'break's. Thanks (again) to Simon B.oster
2002-09-19Nuke an obsolete comment.oster
2002-09-15Release our hold on raidPtr if we're going to sleep.oster
2002-09-14Everyone and their dog was using RF_ERRORMSG3 to print out the sameoster
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.
2002-07-14Remove incorrect comment.oster
2002-07-13Most folks won't need the DAG printing and verification routines.oster
Introduce a #define to toggle them on/off. Disable calls to rf_PrintDAGList(). Saves ~6K on GENERIC+DEBUG kernel on i386.
2002-07-13rf_ValidateDAG isn't something that we want to even consideroster
calling unless DEBUG is turned on.
2001-11-13add RCSIDslukem
2001-09-16Spell 'occurred' with two 'r's.wiz
2000-08-20Use RF_WAIT_COND() to avoid locking errors.thorpej
2000-01-08- nuke calls to rf_get_threadid() and associated #includeoster
- 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-08Minor cleanup.oster
2000-01-07Nuke RF_DECLARE_GLOBAL_THREADID, rf_setup_threadid(), rf_shutdown_threadid(),oster
and rf_assign_threadid(). rf_threadid.h, your days are numbered.
2000-01-05- update RF_CREATE_THREAD to handle a 'process name' argument.oster
- 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.
1999-03-14Disallow interrupting parity re-writes or copybacks by removing PCATCHoster
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-02-05Phase 2 of the RAIDframe cleanup. The source is now closer to KNFoster
and is much easier to read. No functionality changes.
1999-01-26RAIDframe cleanup, phase 1. Nuke simulator support, user-land driver,oster
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.