Author: mav
Date: Sun Dec 29 21:16:03 2019
New Revision: 356185
URL: https://svnweb.freebsd.org/changeset/base/356185

Log:
  Remove GEOM_SCHED class and gsched tool.
  
  This code was not actively maintained since it was introduced 10 years ago.
  It lacks support for many later GEOM features, such as direct dispatch,
  unmapped I/O, stripesize/stripeoffset, resize, etc.  Plus it is the only
  remaining use of GEOM nstart/nend request counters, used there to implement
  live insertion/removal, questionable by itself.  Plus, as number of people
  commented, GEOM is not the best place for I/O scheduler, since it has
  limited information about layers both above and below it, required for
  efficient scheduling.  Plus with the modern shift to SSDs there is just no
  more significant need for this kind of scheduling.
  
  Approved by:  imp, phk, luigi
  Relnotes:     yes

Deleted:
  head/lib/geom/sched/
  head/sys/geom/sched/
  head/sys/modules/geom/geom_sched/
Modified:
  head/lib/geom/Makefile.classes
  head/sys/geom/geom.h
  head/sys/geom/geom_io.c
  head/sys/modules/geom/Makefile
  head/sys/sys/bio.h
  head/sys/sys/ktr_class.h
  head/sys/sys/param.h

Modified: head/lib/geom/Makefile.classes
==============================================================================
--- head/lib/geom/Makefile.classes      Sun Dec 29 20:57:49 2019        
(r356184)
+++ head/lib/geom/Makefile.classes      Sun Dec 29 21:16:03 2019        
(r356185)
@@ -20,7 +20,6 @@ GEOM_CLASSES+=        nop
 GEOM_CLASSES+= part
 GEOM_CLASSES+= raid
 GEOM_CLASSES+= raid3
-GEOM_CLASSES+= sched
 GEOM_CLASSES+= shsec
 GEOM_CLASSES+= stripe
 GEOM_CLASSES+= virstor

Modified: head/sys/geom/geom.h
==============================================================================
--- head/sys/geom/geom.h        Sun Dec 29 20:57:49 2019        (r356184)
+++ head/sys/geom/geom.h        Sun Dec 29 21:16:03 2019        (r356185)
@@ -231,17 +231,6 @@ struct g_provider {
        u_int                   index;
 };
 
-/*
- * Descriptor of a classifier. We can register a function and
- * an argument, which is called by g_io_request() on bio's
- * that are not previously classified.
- */
-struct g_classifier_hook {
-       TAILQ_ENTRY(g_classifier_hook) link;
-       int                     (*func)(void *arg, struct bio *bp);
-       void                    *arg;
-};
-
 /* BIO_GETATTR("GEOM::setstate") argument values. */
 #define G_STATE_FAILED         0
 #define G_STATE_REBUILD                1
@@ -344,8 +333,6 @@ int g_io_getattr(const char *attr, struct g_consumer *
 int g_io_zonecmd(struct disk_zone_args *zone_args, struct g_consumer *cp);
 int g_io_flush(struct g_consumer *cp);
 int g_io_speedup(size_t shortage, u_int flags, size_t *resid, struct 
g_consumer *cp);
-int g_register_classifier(struct g_classifier_hook *hook);
-void g_unregister_classifier(struct g_classifier_hook *hook);
 void g_io_request(struct bio *bp, struct g_consumer *cp);
 struct bio *g_new_bio(void);
 struct bio *g_alloc_bio(void);

Modified: head/sys/geom/geom_io.c
==============================================================================
--- head/sys/geom/geom_io.c     Sun Dec 29 20:57:49 2019        (r356184)
+++ head/sys/geom/geom_io.c     Sun Dec 29 21:16:03 2019        (r356185)
@@ -87,15 +87,6 @@ static volatile u_int __read_mostly pace;
 
 static uma_zone_t __read_mostly biozone;
 
-/*
- * The head of the list of classifiers used in g_io_request.
- * Use g_register_classifier() and g_unregister_classifier()
- * to add/remove entries to the list.
- * Classifiers are invoked in registration order.
- */
-static TAILQ_HEAD(, g_classifier_hook) g_classifier_tailq __read_mostly =
-    TAILQ_HEAD_INITIALIZER(g_classifier_tailq);
-
 #include <machine/atomic.h>
 
 static void
@@ -224,9 +215,6 @@ g_clone_bio(struct bio *bp)
                if (bp->bio_cmd == BIO_ZONE)
                        bcopy(&bp->bio_zone, &bp2->bio_zone,
                            sizeof(bp->bio_zone));
-               /* Inherit classification info from the parent */
-               bp2->bio_classifier1 = bp->bio_classifier1;
-               bp2->bio_classifier2 = bp->bio_classifier2;
 #if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING)
                bp2->bio_track_bp = bp->bio_track_bp;
 #endif
@@ -498,66 +486,7 @@ g_io_check(struct bio *bp)
        return (EJUSTRETURN);
 }
 
-/*
- * bio classification support.
- *
- * g_register_classifier() and g_unregister_classifier()
- * are used to add/remove a classifier from the list.
- * The list is protected using the g_bio_run_down lock,
- * because the classifiers are called in this path.
- *
- * g_io_request() passes bio's that are not already classified
- * (i.e. those with bio_classifier1 == NULL) to g_run_classifiers().
- * Classifiers can store their result in the two fields
- * bio_classifier1 and bio_classifier2.
- * A classifier that updates one of the fields should
- * return a non-zero value.
- * If no classifier updates the field, g_run_classifiers() sets
- * bio_classifier1 = BIO_NOTCLASSIFIED to avoid further calls.
- */
-
-int
-g_register_classifier(struct g_classifier_hook *hook)
-{
-
-       g_bioq_lock(&g_bio_run_down);
-       TAILQ_INSERT_TAIL(&g_classifier_tailq, hook, link);
-       g_bioq_unlock(&g_bio_run_down);
-
-       return (0);
-}
-
 void
-g_unregister_classifier(struct g_classifier_hook *hook)
-{
-       struct g_classifier_hook *entry;
-
-       g_bioq_lock(&g_bio_run_down);
-       TAILQ_FOREACH(entry, &g_classifier_tailq, link) {
-               if (entry == hook) {
-                       TAILQ_REMOVE(&g_classifier_tailq, hook, link);
-                       break;
-               }
-       }
-       g_bioq_unlock(&g_bio_run_down);
-}
-
-static void
-g_run_classifiers(struct bio *bp)
-{
-       struct g_classifier_hook *hook;
-       int classified = 0;
-
-       biotrack(bp, __func__);
-
-       TAILQ_FOREACH(hook, &g_classifier_tailq, link)
-               classified |= hook->func(hook->arg, bp);
-
-       if (!classified)
-               bp->bio_classifier1 = BIO_NOTCLASSIFIED;
-}
-
-void
 g_io_request(struct bio *bp, struct g_consumer *cp)
 {
        struct g_provider *pp;
@@ -639,12 +568,6 @@ g_io_request(struct bio *bp, struct g_consumer *cp)
 #else
        direct = 0;
 #endif
-
-       if (!TAILQ_EMPTY(&g_classifier_tailq) && !bp->bio_classifier1) {
-               g_bioq_lock(&g_bio_run_down);
-               g_run_classifiers(bp);
-               g_bioq_unlock(&g_bio_run_down);
-       }
 
        /*
         * The statistics collection is lockless, as such, but we

Modified: head/sys/modules/geom/Makefile
==============================================================================
--- head/sys/modules/geom/Makefile      Sun Dec 29 20:57:49 2019        
(r356184)
+++ head/sys/modules/geom/Makefile      Sun Dec 29 21:16:03 2019        
(r356185)
@@ -19,7 +19,6 @@ SUBDIR=       geom_bde \
        geom_part \
        geom_raid \
        geom_raid3 \
-       geom_sched \
        geom_shsec \
        geom_stripe \
        geom_uzip \

Modified: head/sys/sys/bio.h
==============================================================================
--- head/sys/sys/bio.h  Sun Dec 29 20:57:49 2019        (r356184)
+++ head/sys/sys/bio.h  Sun Dec 29 21:16:03 2019        (r356185)
@@ -79,9 +79,6 @@ struct disk;
 struct bio;
 struct vm_map;
 
-/* Empty classifier tag, to prevent further classification. */
-#define        BIO_NOTCLASSIFIED               (void *)(~0UL)
-
 typedef void bio_task_t(void *);
 
 /*
@@ -122,8 +119,8 @@ struct bio {
        bio_task_t *bio_task;           /* Task_queue handler */
        void    *bio_task_arg;          /* Argument to above */
 
-       void    *bio_classifier1;       /* Classifier tag. */
-       void    *bio_classifier2;       /* Classifier tag. */
+       void    *bio_spare1;
+       void    *bio_spare2;
 
 #ifdef DIAGNOSTIC
        void    *_bio_caller1;

Modified: head/sys/sys/ktr_class.h
==============================================================================
--- head/sys/sys/ktr_class.h    Sun Dec 29 20:57:49 2019        (r356184)
+++ head/sys/sys/ktr_class.h    Sun Dec 29 21:16:03 2019        (r356185)
@@ -58,7 +58,7 @@
 #define        KTR_SYSC        0x00002000              /* System call */
 #define        KTR_INIT        0x00004000              /* System 
initialization */
 #define        KTR_SPARE3      0x00008000              /* cxgb, drm2, ioat, 
ntb */
-#define        KTR_SPARE4      0x00010000              /* geom_sched */
+#define        KTR_SPARE4      0x00010000
 #define        KTR_EVH         0x00020000              /* Eventhandler */
 #define        KTR_VFS         0x00040000              /* VFS events */
 #define        KTR_VOP         0x00080000              /* Auto-generated vop 
events */

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h        Sun Dec 29 20:57:49 2019        (r356184)
+++ head/sys/sys/param.h        Sun Dec 29 21:16:03 2019        (r356185)
@@ -60,7 +60,7 @@
  *             in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300071      /* Master, propagated to newvers */
+#define __FreeBSD_version 1300072      /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to