summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/rf_map.c
AgeCommit message (Collapse)Author
2019-05-28s/recieve/receive/msaitoh
2019-02-10Introduce PR_ZERO to avoid open-coding memset()s everywhere. OK riastradh@.christos
2019-02-09- Change the allocation macros to be more like function callschristos
- 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.
2016-10-15Cleanup/remove unused asm_count. Reported by David Binderman in PR#51552.oster
Thanks!
2014-11-14Adjust comment to reflect reality. (5th arg, not 4th)oster
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.
2009-03-15ansify function definitionscegger
2007-03-04Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.christos
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-04-26un-bitrot some of this code (which is not included by default in kernels),oster
and make it build again. XXX: Paritylogging bits still won't build.
2005-12-11merge ktrace-lwp.christos
2005-02-27nuke trailing whitespaceperry
2004-03-20For each RAID set, pre-allocate a number of "emergency buffers" to beoster
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-19Take care of six more mallocs:oster
- Pull rf_FreePhysDiskAddr() out from under a #ifdef, since we're now going to use it. - Add a pda_cleanup_list into the DAG header. Use it in rf_FreeDAG() to cleanup any PDA's that get allocated but have no "easy" way of being located and freed when the DAG completes. - numStripeUnitsAccessed is a per-stripe value, and has a maximum value equal to the number of colums (thus limited by RF_MAXCOL). Use this knowledge to set a high-bound on overlappingPDAs, and stuff it on the stack instead of malloc'ing it all the time! This costs us a whopping 40 bytes on the stack, but saves a malloc() and a free().
2004-03-19Add a comment. Will hopefully save time next time someone triesoster
to figure out where the allocated memory is freed.
2004-03-19Introduce 3 more pools and 6 functions to handle allocating/freeingoster
elements from the pools. Re-work rf_SelectAlgorithm() to get rid of all the 8 malloc's, and to use the new functions to get/put these 'support structures'. I'm not overly happy with some of the variable names, but them's the breaks. In the process of changing things, fix a bug: - in the case where we can't create a dag, free asmh_b and blockFuncs too!! [if you were able to look at the source code related to these changes, and comprehend what was going on without having your eyes bleed or getting dizzy, please contact me... I'm sure I'll have more code which would benefit by you having a look at it before I commit 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- 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-07We don't need 2-fault tollerant stuff here in the default case.oster
Use #if's to conditionalize the code compilation. (Saves another 1K on i386 GENERIC kernels)
2004-03-05- remove the RF_*_INC's, as necessary. They are not needed any more.oster
- introduce RF_MIN_*'s, as necessary. These will indicate the low-water mark for pools as well as the pool_prime() value. - add pool_setlowat() for the critical pools. - pool_prime() and pool_setlowat() the raidframe_cbufpool. - re-order some pool_prime()'s and pool_sethiwat()'s for clarity.
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.
2003-12-30No point keeping 'pt' around. It's only ever assigned to.oster
2003-12-30rf_FreePDAList() and rf_FreeASMList() wern't using their l_end oroster
count arguments. Nuke the unused args, and fix up callers and fn prototypes. Rename l_start arguments.
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-29Clean up comments, and generally make more readable. No functional changes.oster
2003-12-29- first kick at a major reworking of RAIDframe's memory allocation code:oster
- 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.
2003-12-29[Having received a definite lack of strenuous objection, a small amountoster
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-21(Although I want this code to Go Away, I might as well fix this bug for ↵oster
completeness) If we don't have enough memory to allocate the pda freelist, make sure to cleanup the asm freelist.
2002-09-24Cleanup the comment formatting a bit.oster
2002-09-23Ooops.. should have included this 'row' with the last change.oster
2002-09-23'row' was defined and set, but never used. *poof* Thanks to Simon B.oster
2002-09-21rf_FreePhysDiskAddr is only needed by paritylogging.oster
rf_NumFailedDataUnitsInStripe is only needed by PQ, RAID6 and EVENODD. rf_PrintAccessStripeMap is only needed for RF_DEBUG_MAP. Thanks Krister!
2002-09-21rf_FreeAccessStripeMapComponent() goes too. Thanks Krister!oster
2002-09-21Nuke rf_AllocAccessStripeMapComponent(). Thanks Krister!oster
2002-09-19Introduce RF_DEBUG_MAP, and use it to ignore more rarely used code.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-08-03Nuke two more functions that arn't used anywhere and are only contributingoster
to kernel bloat.
2002-05-22bcopy -> memcpy. Reviewed by Greg Oster.wiz
2002-01-07Revert previous. Need to be more careful with what gets chopped out.oster
2002-01-07Some of this stuff is really just for debugging, so compile it only ifoster
DEBUG is defined.
2001-11-13add RCSIDslukem
2001-10-05More #if 0's bite the dust.oster
2001-10-04Step 2 of the disentanglement. We now look to <dev/raidframe/*> foroster
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-07-18bzero -> memsetthorpej
2000-06-29Nuke a printf that *I* added at least as early as Nov, 1998, and which isoster
as bogus now as it was then.
1999-08-13rf_sys.h does not need to be #included in any of these files, and, actually,oster
is no longer needed at all.
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.
1998-11-13RAIDframe, version 1.1, from the Parallel Data Laboratory atoster
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.