- remove the RF_*_INC's, as necessary. They are not needed any more.

- 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.
This commit is contained in:
oster 2004-03-05 02:53:55 +00:00
parent 49bcfb35d8
commit a0413593bc
10 changed files with 70 additions and 59 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_alloclist.c,v 1.18 2004/02/29 04:03:50 oster Exp $ */
/* $NetBSD: rf_alloclist.c,v 1.19 2004/03/05 02:53:55 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -37,7 +37,7 @@
***************************************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_alloclist.c,v 1.18 2004/02/29 04:03:50 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_alloclist.c,v 1.19 2004/03/05 02:53:55 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_alloclist.c,v 1.18 2004/02/29 04:03:50 oster Exp
static struct pool rf_alloclist_pool;
#define RF_AL_FREELIST_MAX 256
#define RF_AL_FREELIST_MIN 64
static void rf_ShutdownAllocList(void *);
@ -68,7 +69,9 @@ rf_ConfigureAllocList(RF_ShutdownList_t **listp)
pool_init(&rf_alloclist_pool, sizeof(RF_AllocListElem_t),
0, 0, 0, "rf_alloclist_pl", NULL);
pool_sethiwat(&rf_alloclist_pool, RF_AL_FREELIST_MAX);
pool_prime(&rf_alloclist_pool, 16); /* need something.. */
pool_prime(&rf_alloclist_pool, RF_AL_FREELIST_MIN);
pool_setlowat(&rf_alloclist_pool, RF_AL_FREELIST_MIN);
rf_ShutdownCreate(listp, rf_ShutdownAllocList, NULL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_callback.c,v 1.13 2004/02/29 04:03:50 oster Exp $ */
/* $NetBSD: rf_callback.c,v 1.14 2004/03/05 02:53:58 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -34,7 +34,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.13 2004/02/29 04:03:50 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.14 2004/03/05 02:53:58 oster Exp $");
#include <dev/raidframe/raidframevar.h>
#include <sys/pool.h>
@ -48,8 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.13 2004/02/29 04:03:50 oster Exp $
static struct pool rf_callback_pool;
#define RF_MAX_FREE_CALLBACK 64
#define RF_CALLBACK_INC 4
#define RF_CALLBACK_INITIAL 32
#define RF_MIN_FREE_CALLBACK 32
static void rf_ShutdownCallback(void *);
static void
@ -66,7 +65,8 @@ rf_ConfigureCallback(listp)
pool_init(&rf_callback_pool, sizeof(RF_CallbackDesc_t), 0, 0, 0,
"rf_callbackpl", NULL);
pool_sethiwat(&rf_callback_pool, RF_MAX_FREE_CALLBACK);
pool_prime(&rf_callback_pool, RF_CALLBACK_INITIAL);
pool_prime(&rf_callback_pool, RF_MIN_FREE_CALLBACK);
pool_setlowat(&rf_callback_pool, RF_MIN_FREE_CALLBACK);
rf_ShutdownCreate(listp, rf_ShutdownCallback, NULL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_dagutils.c,v 1.29 2004/02/29 04:03:50 oster Exp $ */
/* $NetBSD: rf_dagutils.c,v 1.30 2004/03/05 02:53:55 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -33,7 +33,7 @@
*****************************************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.29 2004/02/29 04:03:50 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.30 2004/03/05 02:53:55 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@ -169,16 +169,15 @@ rf_FreeDAG(RF_DagHeader_t *dag_h)
static struct pool rf_dagh_pool;
#define RF_MAX_FREE_DAGH 128
#define RF_DAGH_INC 16
#define RF_DAGH_INITIAL 32
#define RF_MIN_FREE_DAGH 32
static struct pool rf_daglist_pool;
#define RF_MAX_FREE_DAGLIST 128
#define RF_DAGLIST_INITIAL 32
#define RF_MIN_FREE_DAGLIST 32
static struct pool rf_funclist_pool;
#define RF_MAX_FREE_FUNCLIST 128
#define RF_FUNCLIST_INITIAL 32
#define RF_MIN_FREE_FUNCLIST 32
static void rf_ShutdownDAGs(void *);
static void
@ -196,17 +195,20 @@ rf_ConfigureDAGs(RF_ShutdownList_t **listp)
pool_init(&rf_dagh_pool, sizeof(RF_DagHeader_t), 0, 0, 0,
"rf_dagh_pl", NULL);
pool_sethiwat(&rf_dagh_pool, RF_MAX_FREE_DAGH);
pool_prime(&rf_dagh_pool, RF_DAGH_INITIAL);
pool_prime(&rf_dagh_pool, RF_MIN_FREE_DAGH);
pool_setlowat(&rf_dagh_pool, RF_MIN_FREE_DAGH);
pool_init(&rf_daglist_pool, sizeof(RF_DagList_t), 0, 0, 0,
"rf_daglist_pl", NULL);
pool_sethiwat(&rf_daglist_pool, RF_MAX_FREE_DAGLIST);
pool_prime(&rf_daglist_pool, RF_DAGLIST_INITIAL);
pool_prime(&rf_daglist_pool, RF_MIN_FREE_DAGLIST);
pool_setlowat(&rf_daglist_pool, RF_MIN_FREE_DAGLIST);
pool_init(&rf_funclist_pool, sizeof(RF_FuncList_t), 0, 0, 0,
"rf_funcist_pl", NULL);
pool_sethiwat(&rf_funclist_pool, RF_MAX_FREE_FUNCLIST);
pool_prime(&rf_funclist_pool, RF_FUNCLIST_INITIAL);
pool_prime(&rf_funclist_pool, RF_MIN_FREE_FUNCLIST);
pool_setlowat(&rf_funclist_pool, RF_MIN_FREE_FUNCLIST);
rf_ShutdownCreate(listp, rf_ShutdownDAGs, NULL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_diskqueue.c,v 1.30 2004/02/29 04:03:50 oster Exp $ */
/* $NetBSD: rf_diskqueue.c,v 1.31 2004/03/05 02:53:55 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -66,7 +66,7 @@
****************************************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.30 2004/02/29 04:03:50 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.31 2004/03/05 02:53:55 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@ -149,8 +149,7 @@ static const RF_DiskQueueSW_t diskqueuesw[] = {
static struct pool rf_dqd_pool;
#define RF_MAX_FREE_DQD 256
#define RF_DQD_INC 16
#define RF_DQD_INITIAL 64
#define RF_MIN_FREE_DQD 64
#include <sys/buf.h>
@ -193,7 +192,8 @@ rf_ConfigureDiskQueueSystem(RF_ShutdownList_t **listp)
pool_init(&rf_dqd_pool, sizeof(RF_DiskQueueData_t), 0, 0, 0,
"rf_dqd_pl", NULL);
pool_sethiwat(&rf_dqd_pool, RF_MAX_FREE_DQD);
pool_prime(&rf_dqd_pool, RF_DQD_INITIAL);
pool_prime(&rf_dqd_pool, RF_MIN_FREE_DQD);
pool_setlowat(&rf_dqd_pool, RF_MIN_FREE_DQD);
rf_ShutdownCreate(listp, rf_ShutdownDiskQueueSystem, NULL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_driver.c,v 1.87 2004/03/01 23:30:58 oster Exp $ */
/* $NetBSD: rf_driver.c,v 1.88 2004/03/05 02:53:56 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.87 2004/03/01 23:30:58 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.88 2004/03/05 02:53:56 oster Exp $");
#include "opt_raid_diagnostic.h"
@ -125,8 +125,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.87 2004/03/01 23:30:58 oster Exp $")
RF_DECLARE_MUTEX(rf_rad_pool_lock)
static struct pool rf_rad_pool;
#define RF_MAX_FREE_RAD 128
#define RF_RAD_INC 16
#define RF_RAD_INITIAL 32
#define RF_MIN_FREE_RAD 32
/* debug variables */
char rf_panicbuf[2048]; /* a buffer to hold an error msg when we panic */
@ -436,7 +435,9 @@ rf_ConfigureRDFreeList(RF_ShutdownList_t **listp)
pool_init(&rf_rad_pool, sizeof(RF_RaidAccessDesc_t), 0, 0, 0,
"rf_rad_pl", NULL);
pool_sethiwat(&rf_rad_pool, RF_MAX_FREE_RAD);
pool_prime(&rf_rad_pool, RF_RAD_INITIAL);
pool_prime(&rf_rad_pool, RF_MIN_FREE_RAD);
pool_setlowat(&rf_rad_pool, RF_MIN_FREE_RAD);
rf_ShutdownCreate(listp, rf_ShutdownRDFreeList, NULL);
simple_lock_init(&rf_rad_pool_lock);
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_map.c,v 1.29 2004/02/29 04:03:50 oster Exp $ */
/* $NetBSD: rf_map.c,v 1.30 2004/03/05 02:53:56 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -33,7 +33,7 @@
**************************************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.29 2004/02/29 04:03:50 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.30 2004/03/05 02:53:56 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@ -311,21 +311,18 @@ rf_MarkFailuresInASMList(RF_Raid_t *raidPtr,
static struct pool rf_asmhdr_pool;
#define RF_MAX_FREE_ASMHDR 128
#define RF_ASMHDR_INC 16
#define RF_ASMHDR_INITIAL 32
#define RF_MIN_FREE_ASMHDR 32
static struct pool rf_asm_pool;
#define RF_MAX_FREE_ASM 192
#define RF_ASM_INC 24
#define RF_ASM_INITIAL 64
#define RF_MIN_FREE_ASM 64
static struct pool rf_pda_pool; /* may need to be visible for
rf_dagdegrd.c and rf_dagdegwr.c,
if they can be convinced to free
the space easily */
#define RF_MAX_FREE_PDA 192
#define RF_PDA_INC 24
#define RF_PDA_INITIAL 64
#define RF_MIN_FREE_PDA 64
/* called at shutdown time. So far, all that is necessary is to
release all the free lists */
@ -345,17 +342,20 @@ rf_ConfigureMapModule(RF_ShutdownList_t **listp)
pool_init(&rf_asmhdr_pool, sizeof(RF_AccessStripeMapHeader_t),
0, 0, 0, "rf_asmhdr_pl", NULL);
pool_sethiwat(&rf_asmhdr_pool, RF_MAX_FREE_ASMHDR);
pool_prime(&rf_asmhdr_pool, RF_ASMHDR_INITIAL);
pool_prime(&rf_asmhdr_pool, RF_MIN_FREE_ASMHDR);
pool_setlowat(&rf_asmhdr_pool, RF_MIN_FREE_ASMHDR);
pool_init(&rf_asm_pool, sizeof(RF_AccessStripeMap_t),
0, 0, 0, "rf_asm_pl", NULL);
pool_sethiwat(&rf_asm_pool, RF_MAX_FREE_ASM);
pool_prime(&rf_asm_pool, RF_ASM_INITIAL);
pool_prime(&rf_asm_pool, RF_MIN_FREE_ASM);
pool_setlowat(&rf_asm_pool, RF_MIN_FREE_ASM);
pool_init(&rf_pda_pool, sizeof(RF_PhysDiskAddr_t),
0, 0, 0, "rf_pda_pl", NULL);
pool_sethiwat(&rf_pda_pool, RF_MAX_FREE_PDA);
pool_prime(&rf_pda_pool, RF_PDA_INITIAL);
pool_prime(&rf_pda_pool, RF_MIN_FREE_PDA);
pool_setlowat(&rf_pda_pool, RF_MIN_FREE_PDA);
rf_ShutdownCreate(listp, rf_ShutdownMapModule, NULL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_mcpair.c,v 1.15 2004/03/04 03:02:01 oster Exp $ */
/* $NetBSD: rf_mcpair.c,v 1.16 2004/03/05 02:53:58 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_mcpair.c,v 1.15 2004/03/04 03:02:01 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_mcpair.c,v 1.16 2004/03/05 02:53:58 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@ -48,8 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_mcpair.c,v 1.15 2004/03/04 03:02:01 oster Exp $")
static struct pool rf_mcpair_pool;
#define RF_MAX_FREE_MCPAIR 128
#define RF_MCPAIR_INC 16
#define RF_MCPAIR_INITIAL 24
#define RF_MIN_FREE_MCPAIR 24
static void rf_ShutdownMCPair(void *);
@ -66,7 +65,8 @@ rf_ConfigureMCPair(RF_ShutdownList_t **listp)
pool_init(&rf_mcpair_pool, sizeof(RF_MCPair_t), 0, 0, 0,
"rf_mcpair_pl", NULL);
pool_sethiwat(&rf_mcpair_pool, RF_MAX_FREE_MCPAIR);
pool_prime(&rf_mcpair_pool, RF_MCPAIR_INITIAL);
pool_prime(&rf_mcpair_pool, RF_MIN_FREE_MCPAIR);
pool_setlowat(&rf_mcpair_pool, RF_MIN_FREE_MCPAIR);
rf_ShutdownCreate(listp, rf_ShutdownMCPair, NULL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_netbsdkintf.c,v 1.175 2004/03/01 23:30:58 oster Exp $ */
/* $NetBSD: rf_netbsdkintf.c,v 1.176 2004/03/05 02:53:58 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@ -146,7 +146,7 @@
***********************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.175 2004/03/01 23:30:58 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.176 2004/03/05 02:53:58 oster Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@ -363,6 +363,8 @@ raidattach(int num)
/* Initialize the component buffer pool. */
pool_init(&raidframe_cbufpool, sizeof(struct raidbuf), 0,
0, 0, "raidpl", NULL);
pool_prime(&raidframe_cbufpool, num * RAIDOUTSTANDING);
pool_setlowat(&raidframe_cbufpool, num * RAIDOUTSTANDING);
rf_mutex_init(&rf_sparet_wait_mutex);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_psstatus.c,v 1.24 2004/03/04 03:27:30 oster Exp $ */
/* $NetBSD: rf_psstatus.c,v 1.25 2004/03/05 02:53:58 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.24 2004/03/04 03:27:30 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_psstatus.c,v 1.25 2004/03/05 02:53:58 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@ -62,8 +62,7 @@ RealPrintPSStatusTable(RF_Raid_t * raidPtr,
RF_PSStatusHeader_t * pssTable);
#define RF_MAX_FREE_PSS 32
#define RF_PSS_INC 8
#define RF_PSS_INITIAL 4
#define RF_MIN_FREE_PSS 8
static void rf_ShutdownPSStatus(void *);
@ -84,15 +83,19 @@ rf_ConfigurePSStatus(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
raidPtr->pssTableSize = RF_PSS_DEFAULT_TABLESIZE;
pool_init(&raidPtr->pss_pool, sizeof(RF_ReconParityStripeStatus_t), 0,
0, 0, "raidpsspl", NULL);
pool_sethiwat(&raidPtr->pss_pool, RF_MAX_FREE_PSS);
pool_prime(&raidPtr->pss_pool, RF_MIN_FREE_PSS);
pool_setlowat(&raidPtr->pss_pool, RF_MIN_FREE_PSS);
pool_init(&raidPtr->pss_issued_pool,
raidPtr->numCol * sizeof(char), 0,
0, 0, "raidpssissuedpl", NULL);
pool_sethiwat(&raidPtr->pss_issued_pool, RF_MAX_FREE_PSS);
pool_prime(&raidPtr->pss_issued_pool, RF_MIN_FREE_PSS);
pool_setlowat(&raidPtr->pss_issued_pool, RF_MIN_FREE_PSS);
rf_ShutdownCreate(listp, rf_ShutdownPSStatus, raidPtr);
pool_sethiwat(&raidPtr->pss_pool, RF_MAX_FREE_PSS);
pool_sethiwat(&raidPtr->pss_issued_pool, RF_MAX_FREE_PSS);
pool_prime(&raidPtr->pss_pool, RF_PSS_INITIAL);
pool_prime(&raidPtr->pss_issued_pool, RF_PSS_INITIAL);
return (0);
}
/*****************************************************************************************

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_stripelocks.c,v 1.23 2004/02/29 04:03:50 oster Exp $ */
/* $NetBSD: rf_stripelocks.c,v 1.24 2004/03/05 02:53:58 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_stripelocks.c,v 1.23 2004/02/29 04:03:50 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_stripelocks.c,v 1.24 2004/03/05 02:53:58 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@ -152,8 +152,7 @@ static void PrintLockedStripes(RF_LockTableEntry_t * lockTable);
static struct pool rf_stripelock_pool;
#define RF_MAX_FREE_STRIPELOCK 128
#define RF_STRIPELOCK_INC 8
#define RF_STRIPELOCK_INITIAL 32
#define RF_MIN_FREE_STRIPELOCK 32
static void rf_ShutdownStripeLocks(RF_LockTableEntry_t * lockTable);
static void rf_ShutdownStripeLockFreeList(void *);
@ -173,7 +172,8 @@ rf_ConfigureStripeLockFreeList(RF_ShutdownList_t **listp)
pool_init(&rf_stripelock_pool, sizeof(RF_StripeLockDesc_t),
0, 0, 0, "rf_stripelock_pl", NULL);
pool_sethiwat(&rf_stripelock_pool, RF_MAX_FREE_STRIPELOCK);
pool_prime(&rf_stripelock_pool, RF_STRIPELOCK_INITIAL);
pool_prime(&rf_stripelock_pool, RF_MIN_FREE_STRIPELOCK);
pool_setlowat(&rf_stripelock_pool, RF_MIN_FREE_STRIPELOCK);
rf_ShutdownCreate(listp, rf_ShutdownStripeLockFreeList, NULL);