summaryrefslogtreecommitdiffstats
path: root/sbin/geom/class/raid3
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2004-08-21 18:11:46 +0000
committerpjd <pjd@FreeBSD.org>2004-08-21 18:11:46 +0000
commitc3c6740d1ae2ca36dd507650dbed6962cc1b206d (patch)
treec7a13feeb4a36d3ad1e0855d38be72d1ee949ab6 /sbin/geom/class/raid3
parentfbfced34e485ed42ca65816dbf7029b29af13d53 (diff)
downloadFreeBSD-src-c3c6740d1ae2ca36dd507650dbed6962cc1b206d.zip
FreeBSD-src-c3c6740d1ae2ca36dd507650dbed6962cc1b206d.tar.gz
Implement new reading algorithm, which will use parity component for reading
as well, even if device is in complete state. I observe 40% of speed-up with this option for random read operations, but slowdown for sequential reads. Basically, without this option reading from a RAID3 device built from 5 components (c0-c4) looks like this: Request no. Used components 1 c0+c1+c2+c3 2 c0+c1+c2+c3 3 c0+c1+c2+c3 With the new feature: Request no. Used components 1 c0+c1+c2+c3 2 (c1^c2^c3^c4)+c1+c2+c3 3 c0+(c0^c2^c3^c4)+c2+c3 4 c0+c1+(c0^c1^c3^c4)+c3 5 c0+c1+c2+(c0^c1^c2^c4) 6 c0+c1+c2+c3 [...]
Diffstat (limited to 'sbin/geom/class/raid3')
-rw-r--r--sbin/geom/class/raid3/geom_raid3.c17
-rw-r--r--sbin/geom/class/raid3/graid3.822
2 files changed, 30 insertions, 9 deletions
diff --git a/sbin/geom/class/raid3/geom_raid3.c b/sbin/geom/class/raid3/geom_raid3.c
index 55b1056..c7120ed 100644
--- a/sbin/geom/class/raid3/geom_raid3.c
+++ b/sbin/geom/class/raid3/geom_raid3.c
@@ -58,6 +58,8 @@ struct g_command class_commands[] = {
{ 'd', "dynamic", NULL, G_TYPE_NONE },
{ 'h', "hardcode", NULL, G_TYPE_NONE },
{ 'n', "noautosync", NULL, G_TYPE_NONE },
+ { 'r', "round_robin", NULL, G_TYPE_NONE },
+ { 'R', "noround_robin", NULL, G_TYPE_NONE },
G_OPT_SENTINEL
}
},
@@ -73,6 +75,7 @@ struct g_command class_commands[] = {
{
{ 'h', "hardcode", NULL, G_TYPE_NONE },
{ 'n', "noautosync", NULL, G_TYPE_NONE },
+ { 'r', "round_robin", NULL, G_TYPE_NONE },
G_OPT_SENTINEL
}
},
@@ -99,10 +102,10 @@ void
usage(const char *comm)
{
fprintf(stderr,
- "usage: %s label [-hnv] name prov prov prov [prov [...]]\n"
+ "usage: %s label [-hnrv] name prov prov prov [prov [...]]\n"
" %s clear [-v] prov [prov [...]]\n"
" %s dump prov [prov [...]]\n"
- " %s configure [-adhnv] name\n"
+ " %s configure [-adhnrRv] name\n"
" %s rebuild [-v] name prov\n"
" %s insert [-hv] <-n number> name prov\n"
" %s remove [-v] <-n number> name\n"
@@ -141,7 +144,8 @@ raid3_label(struct gctl_req *req)
u_char sector[512];
const char *str;
char param[16];
- int *hardcode, *nargs, *noautosync, error, i;
+ int *hardcode, *nargs, *noautosync, *round_robin;
+ int error, i;
unsigned sectorsize;
off_t mediasize;
@@ -184,6 +188,13 @@ raid3_label(struct gctl_req *req)
}
if (*noautosync)
md.md_mflags |= G_RAID3_DEVICE_FLAG_NOAUTOSYNC;
+ round_robin = gctl_get_paraml(req, "round_robin", sizeof(*round_robin));
+ if (round_robin == NULL) {
+ gctl_error(req, "No '%s' argument.", "round_robin");
+ return;
+ }
+ if (*round_robin)
+ md.md_mflags |= G_RAID3_DEVICE_FLAG_ROUND_ROBIN;
hardcode = gctl_get_paraml(req, "hardcode", sizeof(*hardcode));
if (hardcode == NULL) {
gctl_error(req, "No '%s' argument.", "hardcode");
diff --git a/sbin/geom/class/raid3/graid3.8 b/sbin/geom/class/raid3/graid3.8
index f38732d..713f979 100644
--- a/sbin/geom/class/raid3/graid3.8
+++ b/sbin/geom/class/raid3/graid3.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd Aug 18, 2004
+.Dd Aug 20, 2004
.Dt GRAID3 8
.Os
.Sh NAME
@@ -33,7 +33,7 @@
.Sh SYNOPSIS
.Nm
.Cm label
-.Op Fl hnv
+.Op Fl hnrv
.Ar name
.Ar prov
.Ar prov
@@ -46,7 +46,7 @@
.Op Ar prov Op Ar ...
.Nm
.Cm configure
-.Op Fl adhnv
+.Op Fl adhnrRv
.Ar name
.Nm
.Cm rebuild
@@ -106,6 +106,12 @@ Additional options include:
Hardcode providers' names in metadata.
.It Fl n
Turn off autosynchronization of stale components.
+.It Fl r
+Use parity component for reading in round-robin fashion.
+Without this option parity component is not used at all for reading operations
+when device is in complete state.
+With this option specified random I/O read operations are even 40% faster,
+but sequential reads are slower.
.El
.It Cm clear
Clear metadata on the given providers.
@@ -122,6 +128,10 @@ Do not hardcode providers' names in metadata.
Hardcode providers' names in metadata.
.It Fl n
Turn off autosynchronization of stale components.
+.It Fl r
+Turn on round-robin reading.
+.It Fl R
+Turn off round-robin reading.
.El
.It Cm rebuild
Rebuild the given component forcibly.
@@ -167,10 +177,10 @@ Additional options include:
Be more verbose.
.El
.Sh EXAMPLES
-Use 3 disks to setup a RAID3 array. Create a file system, mount it, then unmount
-it and stop device:
+Use 3 disks to setup a RAID3 array (use round-robin reading feature).
+Create a file system, mount it, then unmount it and stop device:
.Bd -literal -offset indent
-graid3 label -v data da0 da1 da2
+graid3 label -v -r data da0 da1 da2
newfs /dev/raid3/data
mount /dev/raid3/data /mnt
[...]
OpenPOWER on IntegriCloud