GEOM Gate committed!

From: Pawel Jakub Dawidek (
Date: 05/03/04

  • Next message: FreeBSD Tinderbox: "[current tinderbox] failure on alpha/alpha"
    Date: Mon, 3 May 2004 23:55:23 +0200


    I committed GEOM Gate. For those who aren't aware of what it is, few words
    of explanation.

    GEOM Gate itself (as a GEOM class) is a bridge between GEOM and userland
    applications that want to handle I/O requests in userland.
    Such an application is able to create a ggate provider by ioctl(2)
    mechnism and receive I/O requests directed to this newly created

    I committed 3 applications that made use of GEOM Gate:

            ggatel(8) - GEOM Gate local control utility.
            ggatec(8) - GEOM Gate network client and control utility.
            ggated(8) - GEOM Gate network daemon.

    Ggatel is only an example for programmers how to use GEOM Gate
    mechanism, but it could also be used as an replacement for md(4)
    file-backed devices or as a "GEOMificator" for not GEOM-aware
    disk devices. For example, one is not able use gbde(8) on floppy
    disks, with ggatel(8) it is possible:

            # ggatel create -u 5 /dev/fd0
            # gbde init /dev/ggate5
            # gbde attach ggate5
            # newfs /dev/ggate5.bde
            # mount /dev/ggate5.bde /secret
            # cp /private/foo /secret/
            # umount /secret
            # gbde detach ggate5
            # ggatel destroy -u 5

    Anyway. More interesting use is disk device (or files) exporting through
    the network. Here is an example how to use CD-ROM from machine 'server'
    on machine 'client':

            server# echo " RO /dev/acd0" > /etc/gg.exports
            server# ggated

            client# ggatec create -u 5 server.mydomain /dev/acd0
            client# mount_cd9660 /dev/ggate5 /cdrom

    That was easy. While playing with GEOM Gate I decided to test
    'make -j2 buildkernel' on GENERIC kernel:

            1: 559s
            2: 560s
            3: 729s
            1 - /usr/src and /usr/obj on local /dev/data.stripe, which
                is two SATA disks striped (~118MB/s).
            2 - /usr/src is on SATA disk /dev/ad6, /usr/obj is on SATA
                disk /dev/ad8, but both disks are exported through 1Gbit
                network with GEOM Gate and used on test machine.
            3 - Simlar situation to 2, but /usr/src and /usr/obj are
                mounted over NFS.
    Interesting. It shows not only that GEOM Gate is faster that NFS
    (what I wanted to proof), but also that disk speed isn't so
    important. I get ~35MB/s on ggate devices over 1Gbit network.

    We can do some optimizations in the future, for example instead of
    copying data from kernel to userland, we should map bio_data into
    userland process, but I'm not a VM guru to do this.

    Thing to note: ggated(8) is absolutely GEOM-unaware and not FreeBSD
    specific at all. It is a simple network daemon that opens given device
    or file and read from/write to it, that's all. So it should be really
    trivial to port it to other operating systems and exports disk devices
    from them.

    Comments, suggestion, bug reports are of course more than welcome.

    Pawel Jakub Dawidek                              
    FreeBSD committer                         Am I Evil? Yes, I Am!

  • Next message: FreeBSD Tinderbox: "[current tinderbox] failure on alpha/alpha"