summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/raidframevar.h
diff options
context:
space:
mode:
authorjld <jld@NetBSD.org>2009-11-17 18:54:26 +0000
committerjld <jld@NetBSD.org>2009-11-17 18:54:26 +0000
commitf1a1ad338d086b6198a2a1eca916942518b76da5 (patch)
tree83e0a061b6741378d421cd5477775dc7a9d3922d /sys/dev/raidframe/raidframevar.h
parent77fd7698f3f73c4d07394834a84c76f09bd6fde6 (diff)
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.
Diffstat (limited to 'sys/dev/raidframe/raidframevar.h')
-rw-r--r--sys/dev/raidframe/raidframevar.h40
1 files changed, 38 insertions, 2 deletions
diff --git a/sys/dev/raidframe/raidframevar.h b/sys/dev/raidframe/raidframevar.h
index 797ecc097d2..e9986f0fa48 100644
--- a/sys/dev/raidframe/raidframevar.h
+++ b/sys/dev/raidframe/raidframevar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: raidframevar.h,v 1.12 2008/04/28 20:23:56 martin Exp $ */
+/* $NetBSD: raidframevar.h,v 1.13 2009/11/17 18:54:26 jld Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -265,6 +265,9 @@ typedef struct RF_StripeLockDesc_s RF_StripeLockDesc_t;
typedef struct RF_ThreadGroup_s RF_ThreadGroup_t;
typedef struct RF_ThroughputStats_s RF_ThroughputStats_t;
+struct rf_paritymap;
+struct rf_paritymap_ondisk;
+
/*
* Important assumptions regarding ordering of the states in this list
* have been made!!! Before disturbing this ordering, look at code in
@@ -446,7 +449,16 @@ typedef struct RF_ComponentLabel_s {
u_int partitionSize; /* number of blocks on this *partition*.
Must exactly match the partition size
from the disklabel. */
- int future_use[33]; /* Future expansion */
+ /* Parity map stuff. */
+ int parity_map_modcount; /* If equal to mod_counter, then the last
+ kernel to touch this label was
+ parity-map-enabled. */
+ u_int parity_map_flags; /* See top of rf_paritymap.h */
+ int parity_map_tickms; /* Length of parity map cooldown ticks. */
+ int parity_map_ntick; /* Number of parity map cooldown ticks. */
+ u_int parity_map_regions; /* Number of parity map regions. */
+ int future_use[28]; /* Future expansion */
+
int autoconfigure; /* automatically configure this RAID set.
0 == no, 1 == yes */
int root_partition; /* Use this set as /
@@ -569,4 +581,28 @@ typedef struct RF_LayoutSW_s {
} RF_LayoutSW_t;
#endif
+
+/* Parity map declarations. */
+#define RF_PARITYMAP_NREG 4096
+#define RF_PARITYMAP_NBYTE howmany(RF_PARITYMAP_NREG, NBBY)
+
+struct rf_pmctrs {
+ uint64_t nwrite, ncachesync, nclearing;
+};
+
+struct rf_pmparams {
+ int cooldown, tickms;
+ u_int regions;
+};
+
+struct rf_pmstat {
+ int enabled; /* if not set, rest of struct is zeroed */
+ struct rf_pmparams params;
+ daddr_t region_size;
+ char dirty[RF_PARITYMAP_NBYTE];
+ struct rf_pmctrs ctrs;
+};
+
+
+
#endif /* !_RF_RAIDFRAMEVAR_H_ */