summaryrefslogtreecommitdiffstats
path: root/sys/geom/vinum/geom_vinum_var.h
diff options
context:
space:
mode:
authorle <le@FreeBSD.org>2004-09-18 13:44:43 +0000
committerle <le@FreeBSD.org>2004-09-18 13:44:43 +0000
commit18ba8315a7f99725d24144b4ba8f020a09eb6c80 (patch)
treeb26a5245ec9f7555a82415414ac98257151bf50c /sys/geom/vinum/geom_vinum_var.h
parent1991acc23e3343dcdae467ab20ed1b0e729ea778 (diff)
downloadFreeBSD-src-18ba8315a7f99725d24144b4ba8f020a09eb6c80.zip
FreeBSD-src-18ba8315a7f99725d24144b4ba8f020a09eb6c80.tar.gz
Re-vamp how I/O is handled in volumes and plexes.
Analogous to the drive level, give each volume and plex a worker thread that picks up and processes incoming and completed BIOs. This should fix the data corruption issues that have come up a few weeks ago and improve performance, especially of RAID5 plexes. The volume level needs a little work, though.
Diffstat (limited to 'sys/geom/vinum/geom_vinum_var.h')
-rw-r--r--sys/geom/vinum/geom_vinum_var.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/geom/vinum/geom_vinum_var.h b/sys/geom/vinum/geom_vinum_var.h
index 38b540f..99c1c37 100644
--- a/sys/geom/vinum/geom_vinum_var.h
+++ b/sys/geom/vinum/geom_vinum_var.h
@@ -111,6 +111,8 @@
#define GV_BIO_DONE 0x01
#define GV_BIO_MALLOC 0x02
#define GV_BIO_ONHOLD 0x04
+#define GV_BIO_SYNCREQ 0x08
+#define GV_BIO_SUCCEED 0x10
/*
* hostname is 256 bytes long, but we don't need to shlep multiple copies in
@@ -269,8 +271,9 @@ struct gv_plex {
off_t synced; /* Count of synced bytes. */
- struct mtx worklist_mtx; /* Mutex for RAID5 worklist. */
- TAILQ_HEAD(,gv_raid5_packet) worklist; /* List of RAID5 work packets. */
+ struct mtx bqueue_mtx; /* Lock for the BIO queue. */
+ TAILQ_HEAD(,gv_bioq) bqueue; /* BIO queue. */
+ TAILQ_HEAD(,gv_raid5_packet) packets; /* RAID5 sub-requests. */
LIST_HEAD(,gv_sd) subdisks; /* List of attached subdisks. */
LIST_ENTRY(gv_plex) in_volume; /* Plex list of associated volume. */
@@ -292,6 +295,14 @@ struct gv_volume {
#define GV_VOL_DOWN 0
#define GV_VOL_UP 1
+ int flags;
+#define GV_VOL_THREAD_ACTIVE 0x01 /* Volume has an active thread. */
+#define GV_VOL_THREAD_DIE 0x02 /* Signal the thread to die. */
+#define GV_VOL_THREAD_DEAD 0x04 /* The thread has died. */
+
+ struct mtx bqueue_mtx; /* Lock for the BIO queue. */
+ TAILQ_HEAD(,gv_bioq) bqueue; /* BIO queue. */
+
LIST_HEAD(,gv_plex) plexes; /* List of attached plexes. */
LIST_ENTRY(gv_volume) volume; /* Entry in vinum config. */
OpenPOWER on IntegriCloud