svn commit: r187218 - user/luigi/geom_sched/sbin/geom/class/sched
Luigi Rizzo
luigi at FreeBSD.org
Wed Jan 14 05:41:08 PST 2009
Author: luigi
Date: Wed Jan 14 13:41:07 2009
New Revision: 187218
URL: http://svn.freebsd.org/changeset/base/187218
Log:
sync with the code in the private tree
Modified:
user/luigi/geom_sched/sbin/geom/class/sched/geom_sched.c
user/luigi/geom_sched/sbin/geom/class/sched/gsched.8
Modified: user/luigi/geom_sched/sbin/geom/class/sched/geom_sched.c
==============================================================================
--- user/luigi/geom_sched/sbin/geom/class/sched/geom_sched.c Wed Jan 14 12:55:33 2009 (r187217)
+++ user/luigi/geom_sched/sbin/geom/class/sched/geom_sched.c Wed Jan 14 13:41:07 2009 (r187218)
@@ -37,31 +37,46 @@
uint32_t lib_version = G_LIB_VERSION;
uint32_t version = G_SCHED_VERSION;
-static char sched[] = "as";
+/*
+ * storage for parameters used by this geom class.
+ * Right now only the scheduler name is used.
+ */
+static char sched[] = "rr"; /* default scheduler */
+
+/*
+ * Adapt to differences in geom library.
+ * in V1 struct g_command misses gc_argname, eld, and G_BOOL is undefined
+ */
+#if G_LIB_VERSION == 1
+#define G_ARGNAME
+#define G_TYPE_BOOL G_TYPE_NUMBER
+#else
+#define G_ARGNAME NULL,
+#endif
struct g_command class_commands[] = {
{ "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL,
{
- { 's', "sched", sched, G_TYPE_STRING },
+ { 'a', "sched", sched, G_TYPE_STRING },
G_OPT_SENTINEL
},
- NULL, "[-v] [-s sched] dev ..."
+ G_ARGNAME "[-v] [-a sched_name] dev ..."
},
{ "configure", G_FLAG_VERBOSE, NULL,
{
G_OPT_SENTINEL
},
- NULL, "[-v] prov ..."
+ G_ARGNAME "[-v] prov ..."
},
{ "destroy", G_FLAG_VERBOSE, NULL,
{
{ 'f', "force", NULL, G_TYPE_BOOL },
G_OPT_SENTINEL
},
- NULL, "[-fv] prov ..."
+ G_ARGNAME "[-fv] prov ..."
},
- { "reset", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL,
- "[-v] prov ..."
+ { "reset", G_FLAG_VERBOSE, NULL, G_NULL_OPTS,
+ G_ARGNAME "[-v] prov ..."
},
G_CMD_SENTINEL
};
Modified: user/luigi/geom_sched/sbin/geom/class/sched/gsched.8
==============================================================================
--- user/luigi/geom_sched/sbin/geom/class/sched/gsched.8 Wed Jan 14 12:55:33 2009 (r187217)
+++ user/luigi/geom_sched/sbin/geom/class/sched/gsched.8 Wed Jan 14 13:41:07 2009 (r187218)
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd September 20, 2007
+.Dd January 10, 2009
.Dt GSCHED 8
.Os
.Sh NAME
@@ -32,6 +32,7 @@
.Nm
.Cm create
.Op Fl v
+.Op Fl a Ar algorithm
.Ar dev ...
.Nm
.Cm configure
@@ -50,7 +51,9 @@
.Sh DESCRIPTION
The
.Nm
-utility changes the scheduling policy of the requests going to its providers.
+utility (also callable as
+.Nm geom sched ... )
+changes the scheduling policy of the requests going to its providers.
By now it just uses a C-LOOK policy with a little anticipation.
.Pp
The first argument to
@@ -59,8 +62,18 @@ indicates an action to be performed:
.Bl -tag -width ".Cm configure"
.It Cm create
Set up a scheduling provider on the given devices.
+.Ar algorithm
+is the name of the scheduling algorithm used for the provider.
+At the moment there are two algorithms,
+.Ar as
+which implements a simple form of anticipatory scheduling,
+and
+.Ar rr
+which implements anticipatory scheduling with round robin service
+among clients.
+.Pp
If the operation succeeds, the new provider should appear with name
-.Pa /dev/ Ns Ao Ar dev Ac Ns Pa .sched .
+.Pa /dev/ Ns Ao Ar dev Ac Ns Pa -sched- .
The kernel module
.Pa geom_sched.ko
will be loaded if it is not loaded already.
@@ -71,16 +84,7 @@ At the moment it is not used at all.
Turn off the given scheduling providers.
.It Cm reset
Do nothing.
-.It Cm list
-See
-.Xr geom 8 .
-.It Cm status
-See
-.Xr geom 8 .
-.It Cm load
-See
-.Xr geom 8 .
-.It Cm unload
+.It Cm list | status | load | unload
See
.Xr geom 8 .
.El
@@ -115,17 +119,23 @@ The following example shows how to creat
.Pa /dev/da0
, and how to destroy it.
.Bd -literal -offset indent
-gsched create -v da0
-gsched destroy -v da0.nop
+# load the geom_sched module
+kldload geom_sched
+# load some scheduler classes used by geom_sched
+kldload gsched_rr gsched_as
+# configure device ad0 to use scheduler 'rr'
+geom sched create -s rr ad0
+# at this point you will have ad0-sched-
+# remove the scheduler on the device
+geom sched destroy -v ad0-sched-
.Ed
.Pp
-.Ed
.Sh SEE ALSO
.Xr geom 4 ,
.Xr geom 8
.Sh HISTORY
The
.Nm
-utility still has to appear, and hopefully it will never do.
+utility appeared in January 2009.
.Sh AUTHORS
.An Fabio Checconi Aq fabio at FreeBSD.org
More information about the svn-src-user
mailing list