Home | History | Annotate | Download | only in raidframe
History log of /src/sys/dev/raidframe/rf_parityscan.c
RevisionDateAuthorComments
 1.38  08-Aug-2021  andvar s/arry/array/
 1.37  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.36  10-Oct-2019  christos branches: 1.36.12;
fix the function pointer and callback mess:
- callback functions return 0 and their result is not checked; make them void.
- there are two types of callbacks and they used to overload their parameters
and the callback structure; separate them into "function" and "value"
callbacks.
- make the wait function signature consistent.
 1.35  09-Feb-2019  christos - Change the allocation macros to be more like function calls
- Change sizeof(type) -> sizeof(*variable)
- Use macros for the long buffer length allocations
- Remove "bit polishing" memsets() -- do them only once
- Remove unnecessary casts

Thanks to oster@ for finding bugs and testing.
 1.34  01-May-2011  mrg branches: 1.34.56;
convert mcpair to kmutex.
 1.33  17-Nov-2009  jld branches: 1.33.4; 1.33.6;
Finally commit the RAIDframe parity map Summer Of Code project.

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.
 1.32  16-Nov-2006  christos branches: 1.32.52; 1.32.64; 1.32.72;
__unused removal on arguments; approved by core.
 1.31  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.30  11-Dec-2005  christos branches: 1.30.20; 1.30.22;
merge ktrace-lwp.
 1.29  29-May-2005  christos branches: 1.29.2;
- avoid variable shadowing
- add a lot of const
- remove parameters from functin declarations
 1.28  27-Feb-2005  perry branches: 1.28.2;
nuke trailing whitespace
 1.27  18-Mar-2004  oster branches: 1.27.8; 1.27.10;
Use rf_AllocDAGNode() to get new DAG nodes.
 1.26  05-Mar-2004  oster Use RF_INCLUDE_PARITY_DECLUSTERING_DS to #if-out more unneeded bits.
(We can't do RF_DISTRIBUTE_SPARE bits without the parity declustering stuff.)
 1.25  02-Mar-2004  oster Fix more cases where mutex locks were being held longer than necessary.

[For the record: The mcpair mutex is being used to protect mcpair->flag.
mcpair gets allocated before each call to rf_DispatchDAG(), so there is no
other process/thread that could be mucking with it. It is only used to
detect the completion of a given parity unit, and rf_DispatchDAG()
only uses it to setup the callback argument for rf_MCPairWakeupFunc()
which will be called when the IO completes. The code after the call
to rf_DispatchDAG() sits and waits for a 'wakeup' on mcpair->cond
(rf_MCPairWakeupFunc() does that). If mcpair->flag is 0 when
rf_DispatchDAG() completes, then rf_MCPairWakeupFunc() hasn't been
called yet (the IO hasn't completed). If it is 1, then the IO is
already done, and we continue on our merry way without sleeping.
Thus, we don't need to hold any lock on mcpair while calling
rf_DispatchDAG().]
 1.24  01-Mar-2004  oster Use RF_ACC_TRACE to #if out more chunks of code related only
to access tracing. (not turned on yet)
 1.23  10-Jan-2004  oster iCleanup the RF_CREATE_PARAM3(). Middle two "arguments" were nothing
but 0 in all cases.
 1.22  31-Dec-2003  oster Fix comments and make function declarations conform.
No functional changes.
 1.21  31-Dec-2003  oster nuke the 'bp' argument to rf_bxor and friends since it is no longer used.
In fact, bp was being set to "NULL" when passed rf_bxor() in
rf_parityscan.c:rf_VerifyParityBasic().
 1.20  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.19  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.18  09-Feb-2003  jdolecek branches: 1.18.2;
constify some
 1.17  24-Sep-2002  oster Nuke some ancient debugging code.
 1.16  23-Sep-2002  oster Clobber basically unused 'pda', and 'unblockNode' and 'wrUnBlock'.
Thanks to Simon B.
 1.15  21-Sep-2002  oster #if 0 an unused stub. Thanks Krister!
 1.14  14-Sep-2002  oster Add two more debugging #defines: RF_DEBUG_RECONBUFFER and RF_DEBUG_VERIFYPARITY.
Use them to reduce kernel bloat by a little more.
 1.13  13-Jul-2002  oster Most folks won't need the DAG printing and verification routines.
Introduce a #define to toggle them on/off. Disable calls to
rf_PrintDAGList(). Saves ~6K on GENERIC+DEBUG kernel on i386.
 1.12  13-Nov-2001  lukem branches: 1.12.8;
add RCSIDs
 1.11  04-Oct-2001  oster 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.
 1.10  18-Jul-2001  thorpej branches: 1.10.2;
bzero -> memset
 1.9  28-May-2000  oster branches: 1.9.4; 1.9.6;
Abort any parity re-writes before unconfiguring a RAID set.
Partially addresses PR#10182.
 1.8  05-Jan-2000  oster branches: 1.8.2;
- 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.
 1.7  13-Aug-1999  oster branches: 1.7.2;
rf_sys.h does not need to be #included in any of these files, and, actually,
is no longer needed at all.
 1.6  10-Aug-1999  oster Don't go ape if there is a problem verifying the parity. Note the condition
and inform the user (as opposed to panicing the system!).
 1.5  10-Aug-1999  oster Trying to rebuild parity on a degraded set is bogus, so don't allow that.
Also, check sooner for a RAID 0 set, since rewriting parity makes no
sense there either.
 1.4  14-Mar-1999  oster branches: 1.4.2;
Cleanup rf_RewriteParity() and rf_VerifyParity(). Nuke unused stuff,
and make more readable.
 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.4.2.2  28-Sep-1999  cgd pull up rev 1.6 from trunk (requested by oster):
Don't panic the system just because there is a problem verifying
the parity.
 1.4.2.1  27-Sep-1999  cgd pull up rev 1.5 from trunk (requested by oster):
Do not allow rebuilding parity on a degraded RAID set. Also, don't
allow parity rewriting on a RAID 0 set, as that makes no sense.
 1.7.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.8.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9.6.4  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.6.3  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.9.6.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.6.1  03-Aug-2001  lukem update to -current
 1.9.4.6  18-Oct-2002  nathanw Catch up to -current.
 1.9.4.5  17-Sep-2002  nathanw Catch up to -current.
 1.9.4.4  01-Aug-2002  nathanw Catch up to -current.
 1.9.4.3  14-Nov-2001  nathanw Catch up to -current.
 1.9.4.2  22-Oct-2001  nathanw Catch up to -current.
 1.9.4.1  24-Aug-2001  nathanw Catch up with -current.
 1.10.2.1  11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.12.8.1  15-Jul-2002  gehenna catch up with -current.
 1.18.2.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.18.2.4  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.18.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.18.2.1  03-Aug-2004  skrll Sync with HEAD
 1.27.10.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.27.8.1  29-Apr-2005  kent sync with -current
 1.28.2.1  17-Jun-2005  tron Pull up revision 1.29 (requested by oster in ticket #472):
- avoid variable shadowing
- add a lot of const
- remove parameters from function declarations
 1.29.2.1  30-Dec-2006  yamt sync with head.
 1.30.22.2  10-Dec-2006  yamt sync with head.
 1.30.22.1  22-Oct-2006  yamt sync with head
 1.30.20.1  18-Nov-2006  ad Sync with head.
 1.32.72.1  21-Apr-2010  matt sync to netbsd-5
 1.32.64.1  10-Dec-2009  snj Pull up following revision(s) (requested by tron in ticket #1187):
sbin/raidctl/raidctl.8: revisions 1.57-1.59 via patch
sbin/raidctl/raidctl.c: revision 1.42 via patch
sys/dev/raidframe/files.raidframe: revision 1.8 via patch
sys/dev/raidframe/rf_copyback.c: revision 1.42 via patch
sys/dev/raidframe/rf_disks.c: revision 1.72 via patch
sys/dev/raidframe/rf_driver.c: revision 1.122 via patch
sys/dev/raidframe/rf_engine.c: revision 1.40 via patch
sys/dev/raidframe/rf_kintf.h: revision 1.21 via patch
sys/dev/raidframe/rf_netbsdkintf.c: revision 1.269 via patch
sys/dev/raidframe/rf_paritymap.c: revisions 1.1-1.3 via patch
sys/dev/raidframe/rf_paritymap.h: revision 1.1 via patch
sys/dev/raidframe/rf_parityscan.c: revision 1.33 via patch
sys/dev/raidframe/rf_parityscan.h: revision 1.8 via patch
sys/dev/raidframe/rf_raid.h: revision 1.38 via patch
sys/dev/raidframe/rf_reconstruct.c: revision 1.108 via patch
sys/dev/raidframe/rf_states.c: revision 1.44 via patch
sys/dev/raidframe/raidframeio.h: revision 1.6 via patch
sys/dev/raidframe/raidframevar.h: revision 1.13 via patch
Pull up the RAIDframe parity map Summer Of Code project.
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.
 1.32.52.1  11-Mar-2010  yamt sync with head
 1.33.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.33.4.1  31-May-2011  rmind sync with head
 1.34.56.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.34.56.1  10-Jun-2019  christos Sync with HEAD
 1.36.12.1  01-Aug-2021  thorpej Sync with HEAD.

RSS XML Feed