RAIDframe was erroneously re-initializing the Parity Stripe Status

pool each time a new array was configured.  This causes grief
with things like 'vmstat -m' by causing it to loop.  Make RAIDframe
only initialize PSS bits once.

Pointed out by simonb@.  Fix tested by simonb@. Thanks!
This commit is contained in:
oster 2006-02-14 01:13:33 +00:00
parent a4163a9fe4
commit 99bb7dc022
3 changed files with 20 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_driver.c,v 1.109 2005/12/11 12:23:37 christos Exp $ */
/* $NetBSD: rf_driver.c,v 1.110 2006/02/14 01:13:33 oster Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@ -73,7 +73,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.109 2005/12/11 12:23:37 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.110 2006/02/14 01:13:33 oster Exp $");
#include "opt_raid_diagnostic.h"
@ -318,6 +318,7 @@ rf_Configure(RF_Raid_t *raidPtr, RF_Config_t *cfgPtr, RF_AutoConfig_t *ac)
DO_INIT_CONFIGURE(rf_ConfigureReconstruction);
DO_INIT_CONFIGURE(rf_ConfigureCopyback);
DO_INIT_CONFIGURE(rf_ConfigureDiskQueueSystem);
DO_INIT_CONFIGURE(rf_ConfigurePSStatus);
isconfigged = 1;
}
RF_UNLOCK_LKMGR_MUTEX(configureMutex);
@ -371,7 +372,8 @@ rf_Configure(RF_Raid_t *raidPtr, RF_Config_t *cfgPtr, RF_AutoConfig_t *ac)
DO_RAID_INIT_CONFIGURE(rf_ConfigureLayout);
DO_RAID_INIT_CONFIGURE(rf_ConfigurePSStatus);
/* Initialize per-RAID PSS bits */
rf_InitPSStatus(raidPtr);
#if RF_INCLUDE_CHAINDECLUSTER > 0
for (col = 0; col < raidPtr->numCol; col++) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_psstatus.c,v 1.30 2005/12/11 12:23:37 christos Exp $ */
/* $NetBSD: rf_psstatus.c,v 1.31 2006/02/14 01:13:33 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -37,7 +37,7 @@
*****************************************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_psstatus.c,v 1.30 2005/12/11 12:23:37 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_psstatus.c,v 1.31 2006/02/14 01:13:33 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@ -74,17 +74,23 @@ rf_ShutdownPSStatus(void *arg)
}
int
rf_ConfigurePSStatus(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
RF_Config_t *cfgPtr)
rf_ConfigurePSStatus(RF_ShutdownList_t **listp)
{
raidPtr->pssTableSize = RF_PSS_DEFAULT_TABLESIZE;
rf_pool_init(&rf_pools.pss, sizeof(RF_ReconParityStripeStatus_t),
"raidpsspl", RF_MIN_FREE_PSS, RF_MAX_FREE_PSS);
rf_ShutdownCreate(listp, rf_ShutdownPSStatus, raidPtr);
rf_ShutdownCreate(listp, rf_ShutdownPSStatus, NULL);
return (0);
}
void
rf_InitPSStatus(RF_Raid_t *raidPtr)
{
raidPtr->pssTableSize = RF_PSS_DEFAULT_TABLESIZE;
}
/*****************************************************************************************
* sets up the pss table
* We pre-allocate a bunch of entries to avoid as much as possible having to

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_psstatus.h,v 1.12 2005/12/11 12:23:37 christos Exp $ */
/* $NetBSD: rf_psstatus.h,v 1.13 2006/02/14 01:13:33 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -122,7 +122,8 @@ struct RF_PSStatusHeader_s {
#define RF_PSS_BUFFERWAIT 0x00000020 /* someone is waiting for a
* buffer for this RU */
int rf_ConfigurePSStatus(RF_ShutdownList_t **, RF_Raid_t *, RF_Config_t *);
int rf_ConfigurePSStatus(RF_ShutdownList_t **);
void rf_InitPSStatus(RF_Raid_t *);
RF_PSStatusHeader_t *rf_MakeParityStripeStatusTable(RF_Raid_t *);
void rf_FreeParityStripeStatusTable(RF_Raid_t *, RF_PSStatusHeader_t *);
RF_ReconParityStripeStatus_t *rf_LookupRUStatus(RF_Raid_t *, RF_PSStatusHeader_t *,