Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-0]: src/sys/dev/raidframe Pull up revision 1.24 (requested by o...



details:   https://anonhg.NetBSD.org/src/rev/e7de6b1a4724
branches:  netbsd-2-0
changeset: 560392:e7de6b1a4724
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Apr 11 11:19:58 2004 +0000

description:
Pull up revision 1.24 (requested by oster in ticket #123):
These changes complete the effective removal of malloc() from all
write paths within RAIDframe.  They also resolve the "panics with
RAID 5 sets with more than 3 components" issue which was present
(briefly) in the commits which were previously supposed to address
the malloc() issue.
With this new code the 5-component RAID 5 set panics are now gone.
It is also now also possible to swap to RAID 5.
The changes made are:
1) Introduce rf_AllocStripeBuffer() and rf_FreeStripeBuffer() to
allocate/free one stripe's worth of space.  rf_AllocStripeBuffer() is
used in rf_MapUnaccessedPortionOfStripe() where it is not sufficient to
allocate memory using just rf_AllocBuffer().  rf_FreeStripeBuffer() is
called from rf_FreeRaidAccDesc(), well after the DAG is finished.
2) Add a set of emergency "stripe buffers" to struct RF_Raid_s.
Arrange for their initialization in rf_Configure().  In low-memory
situations these buffers will be returned by rf_AllocStripeBuffer()
and re-populated by rf_FreeStripeBuffer().
3) Move RF_VoidPointerListElem_t *iobufs from the dagHeader into
into struct RF_RaidAccessDesc_s.  This is more consistent with the
original code, and will not result in items being freed "too early".
4) Add a RF_RaidAccessDesc_t *desc to RF_DagHeader_s so that we have a
way to find desc->iobufs.
5) Arrange for desc in the DagHeader to be initialized in InitHdrNode().
6) Don't cleanup iobufs in rf_FreeDAG() -- the freeing is now delayed
until rf_FreeRaidAccDesc() (which is how the original code handled the
allocList, and for which there seem to be some subtle, undocumented
assumptions).
7) Rename rf_AllocBuffer2() to be rf_AllocBuffer() and remove the
former rf_AllocBuffer().  Fix all callers of rf_AllocBuffer().
(This was how it was *supposed* to be after the last time these
changes were made, before they were backed out).
8) Remove RF_IOBufHeader and all references to it.
9) Remove desc->cleanupList and all references to it.
Fixes PR#20191

diffstat:

 sys/dev/raidframe/rf_dagdegwr.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 351524f4109e -r e7de6b1a4724 sys/dev/raidframe/rf_dagdegwr.c
--- a/sys/dev/raidframe/rf_dagdegwr.c   Sun Apr 11 11:19:50 2004 +0000
+++ b/sys/dev/raidframe/rf_dagdegwr.c   Sun Apr 11 11:19:58 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagdegwr.c,v 1.23 2004/03/23 21:53:36 oster Exp $   */
+/*     $NetBSD: rf_dagdegwr.c,v 1.23.2.1 2004/04/11 11:19:58 tron Exp $        */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_dagdegwr.c,v 1.23 2004/03/23 21:53:36 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagdegwr.c,v 1.23.2.1 2004/04/11 11:19:58 tron Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -368,7 +368,7 @@
        parityPDA->numSector = failedPDA->numSector;
 
        if (!xorTargetBuf) {
-               xorTargetBuf = rf_AllocBuffer(raidPtr, rf_RaidAddressToByte(raidPtr, failedPDA->numSector), allocList);
+               xorTargetBuf = rf_AllocBuffer(raidPtr, dag_h, rf_RaidAddressToByte(raidPtr, failedPDA->numSector));
        }
        /* init the Wnp node */
        rf_InitNode(wnpNode, rf_wait, RF_FALSE, rf_DiskWriteFunc, rf_DiskWriteUndoFunc,



Home | Main Index | Thread Index | Old Index