Index: g_raid3.c =================================================================== RCS file: /usr/repo/src/sys/geom/raid3/g_raid3.c,v retrieving revision 1.53 diff -u -p -r1.53 g_raid3.c --- g_raid3.c 12 Feb 2006 17:38:09 -0000 1.53 +++ g_raid3.c 16 Feb 2006 07:03:18 -0000 @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD: src/sys/geom/raid3/g #include #include #include -#include #include #include #include @@ -76,42 +75,11 @@ TUNABLE_INT("kern.geom.raid3.disconnect_ SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, disconnect_on_failure, CTLFLAG_RW, &g_raid3_disconnect_on_failure, 0, "Disconnect component on I/O failure."); -static u_int g_raid3_n64k = 50; -TUNABLE_INT("kern.geom.raid3.n64k", &g_raid3_n64k); -SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n64k, CTLFLAG_RD, &g_raid3_n64k, 0, - "Maximum number of 64kB allocations"); -static u_int g_raid3_n16k = 200; -TUNABLE_INT("kern.geom.raid3.n16k", &g_raid3_n16k); -SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n16k, CTLFLAG_RD, &g_raid3_n16k, 0, - "Maximum number of 16kB allocations"); -static u_int g_raid3_n4k = 1200; -TUNABLE_INT("kern.geom.raid3.n4k", &g_raid3_n4k); -SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n4k, CTLFLAG_RD, &g_raid3_n4k, 0, - "Maximum number of 4kB allocations"); - SYSCTL_NODE(_kern_geom_raid3, OID_AUTO, stat, CTLFLAG_RW, 0, "GEOM_RAID3 statistics"); static u_int g_raid3_parity_mismatch = 0; SYSCTL_UINT(_kern_geom_raid3_stat, OID_AUTO, parity_mismatch, CTLFLAG_RD, &g_raid3_parity_mismatch, 0, "Number of failures in VERIFY mode"); -static u_int g_raid3_64k_requested = 0; -SYSCTL_UINT(_kern_geom_raid3_stat, OID_AUTO, 64k_requested, CTLFLAG_RD, - &g_raid3_64k_requested, 0, "Number of requested 64kB allocations"); -static u_int g_raid3_64k_failed = 0; -SYSCTL_UINT(_kern_geom_raid3_stat, OID_AUTO, 64k_failed, CTLFLAG_RD, - &g_raid3_64k_failed, 0, "Number of failed 64kB allocations"); -static u_int g_raid3_16k_requested = 0; -SYSCTL_UINT(_kern_geom_raid3_stat, OID_AUTO, 16k_requested, CTLFLAG_RD, - &g_raid3_16k_requested, 0, "Number of requested 16kB allocations"); -static u_int g_raid3_16k_failed = 0; -SYSCTL_UINT(_kern_geom_raid3_stat, OID_AUTO, 16k_failed, CTLFLAG_RD, - &g_raid3_16k_failed, 0, "Number of failed 16kB allocations"); -static u_int g_raid3_4k_requested = 0; -SYSCTL_UINT(_kern_geom_raid3_stat, OID_AUTO, 4k_requested, CTLFLAG_RD, - &g_raid3_4k_requested, 0, "Number of requested 4kB allocations"); -static u_int g_raid3_4k_failed = 0; -SYSCTL_UINT(_kern_geom_raid3_stat, OID_AUTO, 4k_failed, CTLFLAG_RD, - &g_raid3_4k_failed, 0, "Number of failed 4kB allocations"); #define MSLEEP(ident, mtx, priority, wmesg, timeout) do { \ G_RAID3_DEBUG(4, "%s: Sleeping %p.", __func__, (ident)); \ @@ -600,9 +568,6 @@ g_raid3_destroy_device(struct g_raid3_so g_raid3_disconnect_consumer(sc, cp); sc->sc_sync.ds_geom->softc = NULL; g_wither_geom(sc->sc_sync.ds_geom, ENXIO); - uma_zdestroy(sc->sc_zone_64k); - uma_zdestroy(sc->sc_zone_16k); - uma_zdestroy(sc->sc_zone_4k); mtx_destroy(&sc->sc_queue_mtx); mtx_destroy(&sc->sc_events_mtx); G_RAID3_DEBUG(0, "Device %s destroyed.", gp->name); @@ -919,18 +884,11 @@ static void g_raid3_destroy_bio(struct g_raid3_softc *sc, struct bio *cbp) { struct bio *bp, *pbp; - size_t size; pbp = cbp->bio_parent; pbp->bio_children--; KASSERT(cbp->bio_data != NULL, ("NULL bio_data")); - size = pbp->bio_length / (sc->sc_ndisks - 1); - if (size > 16384) - uma_zfree(sc->sc_zone_64k, cbp->bio_data); - else if (size > 4096) - uma_zfree(sc->sc_zone_16k, cbp->bio_data); - else - uma_zfree(sc->sc_zone_4k, cbp->bio_data); + free(cbp->bio_data, M_RAID3); if (G_RAID3_HEAD_BIO(pbp) == cbp) { G_RAID3_HEAD_BIO(pbp) = G_RAID3_NEXT_BIO(cbp); G_RAID3_NEXT_BIO(cbp) = NULL; @@ -960,23 +918,8 @@ g_raid3_clone_bio(struct g_raid3_softc * if (cbp == NULL) return (NULL); size = pbp->bio_length / (sc->sc_ndisks - 1); - if (size > 16384) { - cbp->bio_data = uma_zalloc(sc->sc_zone_64k, M_NOWAIT); - g_raid3_64k_requested++; - } else if (size > 4096) { - cbp->bio_data = uma_zalloc(sc->sc_zone_16k, M_NOWAIT); - g_raid3_16k_requested++; - } else { - cbp->bio_data = uma_zalloc(sc->sc_zone_4k, M_NOWAIT); - g_raid3_4k_requested++; - } + cbp->bio_data = malloc(size, M_RAID3, M_NOWAIT); if (cbp->bio_data == NULL) { - if (size > 16384) - g_raid3_64k_failed++; - else if (size > 4096) - g_raid3_16k_failed++; - else - g_raid3_4k_failed++; pbp->bio_children--; g_destroy_bio(cbp); return (NULL); @@ -2808,23 +2751,11 @@ g_raid3_create(struct g_class *mp, const gp->softc = sc; gp->orphan = g_raid3_orphan; sc->sc_sync.ds_geom = gp; - sc->sc_zone_64k = uma_zcreate("gr3:64k", 65536, NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); - uma_zone_set_max(sc->sc_zone_64k, g_raid3_n64k); - sc->sc_zone_16k = uma_zcreate("gr3:16k", 16384, NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); - uma_zone_set_max(sc->sc_zone_16k, g_raid3_n16k); - sc->sc_zone_4k = uma_zcreate("gr3:4k", 4096, NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); - uma_zone_set_max(sc->sc_zone_4k, g_raid3_n4k); error = kthread_create(g_raid3_worker, sc, &sc->sc_worker, 0, 0, "g_raid3 %s", md->md_name); if (error != 0) { G_RAID3_DEBUG(1, "Cannot create kernel thread for %s.", sc->sc_name); - uma_zdestroy(sc->sc_zone_64k); - uma_zdestroy(sc->sc_zone_16k); - uma_zdestroy(sc->sc_zone_4k); g_destroy_geom(sc->sc_sync.ds_geom); mtx_destroy(&sc->sc_events_mtx); mtx_destroy(&sc->sc_queue_mtx); Index: g_raid3.h =================================================================== RCS file: /usr/repo/src/sys/geom/raid3/g_raid3.h,v retrieving revision 1.15 diff -u -p -r1.15 g_raid3.h --- g_raid3.h 11 Feb 2006 17:42:31 -0000 1.15 +++ g_raid3.h 15 Feb 2006 14:12:22 -0000 @@ -189,10 +189,6 @@ struct g_raid3_softc { u_int sc_round_robin; struct g_raid3_disk *sc_syncdisk; - uma_zone_t sc_zone_64k; - uma_zone_t sc_zone_16k; - uma_zone_t sc_zone_4k; - u_int sc_genid; /* Generation ID. */ u_int sc_syncid; /* Synchronization ID. */ int sc_bump_id; Index: g_raid3_ctl.c =================================================================== RCS file: /usr/repo/src/sys/geom/raid3/g_raid3_ctl.c,v retrieving revision 1.12 diff -u -p -r1.12 g_raid3_ctl.c --- g_raid3_ctl.c 1 Feb 2006 12:06:01 -0000 1.12 +++ g_raid3_ctl.c 15 Feb 2006 14:12:22 -0000 @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD: src/sys/geom/raid3/g #include #include #include -#include #include #include #include