Date: Thu, 8 Jan 2009 12:39:40 +0000 (UTC) From: Luigi Rizzo <luigi@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r186895 - in user/luigi/geom_sched/sbin/geom/class: . disk sched Message-ID: <200901081239.n08CdeXx022482@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luigi Date: Thu Jan 8 12:39:40 2009 New Revision: 186895 URL: http://svn.freebsd.org/changeset/base/186895 Log: add control libraries for the two new classes Added: user/luigi/geom_sched/sbin/geom/class/disk/ user/luigi/geom_sched/sbin/geom/class/disk/Makefile user/luigi/geom_sched/sbin/geom/class/disk/geom_disk.c user/luigi/geom_sched/sbin/geom/class/sched/ user/luigi/geom_sched/sbin/geom/class/sched/Makefile 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/Makefile Modified: user/luigi/geom_sched/sbin/geom/class/Makefile ============================================================================== --- user/luigi/geom_sched/sbin/geom/class/Makefile Thu Jan 8 12:22:37 2009 (r186894) +++ user/luigi/geom_sched/sbin/geom/class/Makefile Thu Jan 8 12:39:40 2009 (r186895) @@ -4,6 +4,7 @@ SUBDIR= cache SUBDIR+=concat +SUBDIR+=disk .if ${MK_OPENSSL} != "no" SUBDIR+=eli .endif @@ -14,6 +15,7 @@ SUBDIR+=multipath SUBDIR+=nop SUBDIR+=part SUBDIR+=raid3 +SUBDIR+=sched SUBDIR+=shsec SUBDIR+=stripe SUBDIR+=virstor Added: user/luigi/geom_sched/sbin/geom/class/disk/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/luigi/geom_sched/sbin/geom/class/disk/Makefile Thu Jan 8 12:39:40 2009 (r186895) @@ -0,0 +1,12 @@ +# GEOM_LIBRARY_PATH + +.PATH: ${.CURDIR}/../../misc + +#SHLIB_NAME?=geom_${CLASS}.so +#LINKS= ${BINDIR}/geom ${BINDIR}/g${CLASS} +#SRCS+= geom_${CLASS}.c subr.c +#CFLAGS+= -I/usr/src/sbin/geom/ + +CLASS=disk + +.include <bsd.lib.mk> Added: user/luigi/geom_sched/sbin/geom/class/disk/geom_disk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/luigi/geom_sched/sbin/geom/class/disk/geom_disk.c Thu Jan 8 12:39:40 2009 (r186895) @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 2008 Fabio Checconi + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <sys/cdefs.h> + +#include <stdio.h> +#include <stdint.h> +#include <libgeom.h> + +#include <geom/geom.h> +#include "core/geom.h" + +uint32_t lib_version = G_LIB_VERSION; +uint32_t version = G_VERSION; + +static char iosched[] = "gs_as"; + +struct g_command class_commands[] = { + { "configure", G_FLAG_VERBOSE, NULL, + { + { 's', "iosched", iosched, G_TYPE_STRING }, + G_OPT_SENTINEL + }, + NULL, "[-v] [-s iosched] prov ..." + }, + G_CMD_SENTINEL +}; Added: user/luigi/geom_sched/sbin/geom/class/sched/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/luigi/geom_sched/sbin/geom/class/sched/Makefile Thu Jan 8 12:39:40 2009 (r186895) @@ -0,0 +1,7 @@ +# GEOM_LIBRARY_PATH + +.PATH: ${.CURDIR}/../../misc + +CLASS=sched + +.include <bsd.lib.mk> Added: user/luigi/geom_sched/sbin/geom/class/sched/geom_sched.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/luigi/geom_sched/sbin/geom/class/sched/geom_sched.c Thu Jan 8 12:39:40 2009 (r186895) @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 2007 Fabio Checconi <fabio@FreeBSD.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <sys/cdefs.h> + +#include <stdio.h> +#include <stdint.h> +#include <libgeom.h> + +#include "core/geom.h" + +#define G_SCHED_VERSION 0 + +uint32_t lib_version = G_LIB_VERSION; +uint32_t version = G_SCHED_VERSION; + +static char sched[] = "as"; + +struct g_command class_commands[] = { + { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, + { + { 's', "sched", sched, G_TYPE_STRING }, + G_OPT_SENTINEL + }, + NULL, "[-v] [-s sched] dev ..." + }, + { "configure", G_FLAG_VERBOSE, NULL, + { + G_OPT_SENTINEL + }, + NULL, "[-v] prov ..." + }, + { "destroy", G_FLAG_VERBOSE, NULL, + { + { 'f', "force", NULL, G_TYPE_BOOL }, + G_OPT_SENTINEL + }, + NULL, "[-fv] prov ..." + }, + { "reset", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, + "[-v] prov ..." + }, + G_CMD_SENTINEL +}; Added: user/luigi/geom_sched/sbin/geom/class/sched/gsched.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/luigi/geom_sched/sbin/geom/class/sched/gsched.8 Thu Jan 8 12:39:40 2009 (r186895) @@ -0,0 +1,137 @@ +.\" Copyright (c) 2007 Fabio Checconi <fabio@FreeBSD.org> +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd September 20, 2007 +.Dt GSCHED 8 +.Os +.Sh NAME +.Nm gsched +.Nd "control utility for SCHED GEOM class" +.Sh SYNOPSIS +.Nm +.Cm create +.Op Fl v +.Ar dev ... +.Nm +.Cm configure +.Op Fl v +.Ar prov ... +.Nm +.Cm destroy +.Op Fl fv +.Ar prov ... +.Nm +.Cm reset +.Op Fl v +.Ar prov ... +.Nm +.Cm list +.Nm +.Cm status +.Nm +.Cm load +.Nm +.Cm unload +.Sh DESCRIPTION +The +.Nm +utility 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 +.Nm +indicates an action to be performed: +.Bl -tag -width ".Cm configure" +.It Cm create +Set up a scheduling provider on the given devices. +If the operation succeeds, the new provider should appear with name +.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. +.It Cm configure +Configure existing scheduling provider. +At the moment it is not used at all. +.It Cm destroy +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 +See +.Xr geom 8 . +.El +.Pp +Additional options: +.Bl -tag -width ".Fl f" +.It Fl f +Force the removal of the specified provider. +.It Fl v +Be more verbose. +.El +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variables can be used to control the behavior of the +.Nm SCHED +GEOM class. +The default value is shown next to each variable. +.Bl -tag -width indent +.It Va kern.geom.sched.debug : No 0 +Debug level of the +.Nm NOP +GEOM class. +This can be set to a number between 0 and 2 inclusive. +If set to 0 minimal debug information is printed, and if set to 2 the +maximum amount of debug information is printed. +.El +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command fails. +.Sh EXAMPLES +The following example shows how to create a scheduling provider for disk +.Pa /dev/da0 +, and how to destroy it. +.Bd -literal -offset indent +gnop create -v da0 +gnop destroy -v da0.nop +.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. +.Sh AUTHORS +.An Fabio Checconi Aq fabio@FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901081239.n08CdeXx022482>