Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Feb 2011 14:33:19 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r218608 - projects/graid/head/sys/geom/raid
Message-ID:  <201102121433.p1CEXJDE004546@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Feb 12 14:33:19 2011
New Revision: 218608
URL: http://svn.freebsd.org/changeset/base/218608

Log:
  Make read_err_thresh variable/sysctl/tunable global. I don't see good
  reason why different RAID levels may need different threshold values.

Modified:
  projects/graid/head/sys/geom/raid/g_raid.c
  projects/graid/head/sys/geom/raid/g_raid.h
  projects/graid/head/sys/geom/raid/tr_raid1.c

Modified: projects/graid/head/sys/geom/raid/g_raid.c
==============================================================================
--- projects/graid/head/sys/geom/raid/g_raid.c	Sat Feb 12 13:41:02 2011	(r218607)
+++ projects/graid/head/sys/geom/raid/g_raid.c	Sat Feb 12 14:33:19 2011	(r218608)
@@ -59,14 +59,20 @@ u_int g_raid_debug = 2;
 TUNABLE_INT("kern.geom.raid.debug", &g_raid_debug);
 SYSCTL_UINT(_kern_geom_raid, OID_AUTO, debug, CTLFLAG_RW, &g_raid_debug, 0,
     "Debug level");
+int g_raid_read_err_thresh = 10;
+TUNABLE_INT("kern.geom.raid.read_err_thresh", &g_raid_read_err_thresh);
+SYSCTL_UINT(_kern_geom_raid, OID_AUTO, read_err_thresh, CTLFLAG_RW,
+    &g_raid_read_err_thresh, 0,
+    "Number of read errors equated to disk failure");
 u_int g_raid_start_timeout = 15;
 TUNABLE_INT("kern.geom.raid.start_timeout", &g_raid_start_timeout);
-SYSCTL_UINT(_kern_geom_raid, OID_AUTO, timeout, CTLFLAG_RW, &g_raid_start_timeout,
-    0, "Time to wait for all array components");
-static u_int g_raid_cleantime = 5;
-TUNABLE_INT("kern.geom.raid.cleantime", &g_raid_cleantime);
-SYSCTL_UINT(_kern_geom_raid, OID_AUTO, cleantime, CTLFLAG_RW,
-    &g_raid_cleantime, 0, "Mark volume as clean when idling");
+SYSCTL_UINT(_kern_geom_raid, OID_AUTO, start_timeout, CTLFLAG_RW,
+    &g_raid_start_timeout, 0,
+    "Time to wait for all array components");
+static u_int g_raid_clean_time = 5;
+TUNABLE_INT("kern.geom.raid.clean_time", &g_raid_clean_time);
+SYSCTL_UINT(_kern_geom_raid, OID_AUTO, clean_time, CTLFLAG_RW,
+    &g_raid_clean_time, 0, "Mark volume as clean when idling");
 static u_int g_raid_disconnect_on_failure = 1;
 TUNABLE_INT("kern.geom.raid.disconnect_on_failure",
     &g_raid_disconnect_on_failure);
@@ -709,7 +715,7 @@ g_raid_clean(struct g_raid_volume *vol, 
 		return (0);
 	if (acw > 0 || (acw == -1 &&
 	    vol->v_provider != NULL && vol->v_provider->acw > 0)) {
-		timeout = g_raid_cleantime - (time_uptime - vol->v_last_write);
+		timeout = g_raid_clean_time - (time_uptime - vol->v_last_write);
 		if (timeout > 0)
 			return (timeout);
 	}

Modified: projects/graid/head/sys/geom/raid/g_raid.h
==============================================================================
--- projects/graid/head/sys/geom/raid/g_raid.h	Sat Feb 12 13:41:02 2011	(r218607)
+++ projects/graid/head/sys/geom/raid/g_raid.h	Sat Feb 12 14:33:19 2011	(r218608)
@@ -50,6 +50,7 @@ struct g_raid_tr_object;
 #ifdef _KERNEL
 extern u_int g_raid_aggressive_spare;
 extern u_int g_raid_debug;
+extern int g_raid_read_err_thresh;
 extern u_int g_raid_start_timeout;
 extern struct g_class g_raid_class;
 

Modified: projects/graid/head/sys/geom/raid/tr_raid1.c
==============================================================================
--- projects/graid/head/sys/geom/raid/tr_raid1.c	Sat Feb 12 13:41:02 2011	(r218607)
+++ projects/graid/head/sys/geom/raid/tr_raid1.c	Sat Feb 12 14:33:19 2011	(r218608)
@@ -46,19 +46,12 @@ SYSCTL_DECL(_kern_geom_raid);
 SYSCTL_NODE(_kern_geom_raid, OID_AUTO, raid1, CTLFLAG_RW, 0,
     "RAID1 parameters");
 
-#define RAID1_READ_ERR_THRESH 10 /* errors to cause a rebuild */
-static int g_raid1_read_err_thresh = RAID1_READ_ERR_THRESH;
-TUNABLE_INT("kern.geom.raid.raid1.read_err_thresh", &g_raid1_read_err_thresh);
-SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, read_err_thresh, CTLFLAG_RW,
-    &g_raid1_read_err_thresh, RAID1_READ_ERR_THRESH,
-    "Number of read errors on a subdisk that trigger a rebuild");
-
 #define RAID1_REBUILD_SLAB	(1 << 20) /* One transation in a rebuild */
 static int g_raid1_rebuild_slab = RAID1_REBUILD_SLAB;
 TUNABLE_INT("kern.geom.raid.raid1.rebuild_slab_size",
     &g_raid1_rebuild_slab);
 SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_slab_size, CTLFLAG_RW,
-    &g_raid1_rebuild_slab, RAID1_REBUILD_SLAB,
+    &g_raid1_rebuild_slab, 0,
     "Amount of the disk to rebuild each read/write cycle of the rebuild.");
 
 #define RAID1_REBUILD_FAIR_IO 20 /* use 1/x of the available I/O */
@@ -66,7 +59,7 @@ static int g_raid1_rebuild_fair_io = RAI
 TUNABLE_INT("kern.geom.raid.raid1.rebuild_fair_io",
     &g_raid1_rebuild_fair_io);
 SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_fair_io, CTLFLAG_RW,
-    &g_raid1_rebuild_fair_io, RAID1_REBUILD_FAIR_IO,
+    &g_raid1_rebuild_fair_io, 0,
     "Fraction of the I/O bandwidth to use when disk busy for rebuild.");
 
 #define RAID1_REBUILD_CLUSTER_IDLE 100
@@ -74,7 +67,7 @@ static int g_raid1_rebuild_cluster_idle 
 TUNABLE_INT("kern.geom.raid.raid1.rebuild_cluster_idle",
     &g_raid1_rebuild_cluster_idle);
 SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_cluster_idle, CTLFLAG_RW,
-    &g_raid1_rebuild_cluster_idle, RAID1_REBUILD_CLUSTER_IDLE,
+    &g_raid1_rebuild_cluster_idle, 0,
     "Number of slabs to do each time we trigger a rebuild cycle");
 
 #define RAID1_REBUILD_META_UPDATE 1024 /* update meta data every 1GB or so */
@@ -82,7 +75,7 @@ static int g_raid1_rebuild_meta_update =
 TUNABLE_INT("kern.geom.raid.raid1.rebuild_meta_update",
     &g_raid1_rebuild_meta_update);
 SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_meta_update, CTLFLAG_RW,
-    &g_raid1_rebuild_meta_update, RAID1_REBUILD_META_UPDATE,
+    &g_raid1_rebuild_meta_update, 0,
     "When to update the meta data.");
 
 static MALLOC_DEFINE(M_TR_RAID1, "tr_raid1_data", "GEOM_RAID RAID1 data");
@@ -833,7 +826,7 @@ rebuild_round_done:
 		 * drive, which kicks off a resync?
 		 */
 		do_write = 1;
-		if (sd->sd_disk->d_read_errs > g_raid1_read_err_thresh) {
+		if (sd->sd_disk->d_read_errs > g_raid_read_err_thresh) {
 			g_raid_tr_raid1_fail_disk(sd->sd_softc, sd, sd->sd_disk);
 			if (pbp->bio_children == 1)
 				do_write = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102121433.p1CEXJDE004546>