RFC: adding 'proxy' nodes to provider ports (with patch)

Luigi Rizzo rizzo at iet.unipi.it
Sat Mar 21 18:16:45 PDT 2009


On Sat, Mar 21, 2009 at 9:24 PM, Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:
> In message <20090321200334.GB3102 at garage.freebsd.pl>, Pawel Jakub Dawidek write
> s:
>
>>       Special GEOM classes.
>>       ---------------------
>>
>>       - There are no special GEOM classes.
>>
>>I wonder if phk changed his opinion over time. :)
>
> He didn't.
>
>>Maybe instead of adding special providers and GEOM classes, the
>>infrastructure should be extended in some way, so that we won't use
>>provider term to describe something that isn't really a regular GEOM
>>provider.
>
> I have not had time to read this entire thread, being somewhat
> snowed under with work elsewhere.

...
> With that said: I always envisioned the ability to insert and
> delete transparant nodes, with the poster boy example being:
>
>        insert a mirror geom
>        add a mirror on some other provider
>        sync them.
>        delete the old mirro copy
>        pull the mirror mirror geom out again
>
> and (tada!) you have migrated a live partition from one disk to
> another.
>
> For that to work, the new class has to end up between the
> consumer(s) and the geom-class, and I generally planned to
> stick a {geom-consumer-provider}  combination in between
> the provider and its class, rather than a {provider-geom-consumer}
> between the consumer and its provider.
>
> The reason for this, is that it can be done without stalling
> the I/O stream since bios all have built in return tickets.
>
> So I think, my opinion on this proposal is:
>
...

>
> 2. There still are not, and should not be created any special GEOM
>   classes.  GEOM derives much of it's strength from the fact that
>   there are no special cases to handle, that shouldn't be sold
>   too cheaply.
>
> 3. Do it properly instead: Implement the general insert/remove
>   properly, so that we can do things like the "move" example above.
>
> Poul-Henning
>
> --
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> phk at FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
>

With the scheduling issues hopefully addressed in the other email/thread:

the only thing we asked in this thread is whether a transparent
insert/remove in GEOM is already possible, or it must be implemented.

It looks like we are in the latter case, so one option we suggested
(and implemented) was to stick "something" between the provider
and its class, with this "something" being a regular geom class.

http://info.iet.unipi.it/~luigi/FreeBSD/20090319-geom-proxy.patch


This seems to be almost (see [1]) perfectly in line with your
suggestion above, does not cause deviations from the model, and
does not introducte special classes (see [2]).

The only thing we need is adding two pointers to decouple the
provider from its geom.  I'd love to know if a better way exists,
maybe the behaviour described in note [1] below is what you had in
mind ?


[1]: The way i can read your sententence
        ...  stick a {geom-consumer-provider} combination in between
        the provider and its class,
    is the following: take the existing provider "pp" attached to geom "gp"
    and make it the provider of the new geom "new_gp".
    Then create a new provider, "new_pp", link it to "gp",
    and link the consumer of "new_gp" to "new_pp". So we have the following:
    (each node is in square brackets):

        BEFORE  ---> [ pp --> gp ...   ]
        AFTER   ---> [ pp --> new_gp --> new_cp ] ---> [ new_pp --> gp ... ]

    On removal, relink "pp" to "gp" and destroy all the new_* stuff.
    This should save the extra pointers in the struct g_provider,
    and perhaps not much harder to implement than what we did ?

[2] the GEOM_PROXY flag that we suggested is just an optimization to
    avoid calling taste() on a provider that nobody should be interested
    in attaching to. I think its presence does not change the model,
    but nothing bad happens if we don't use this flag.


How does it sound now ?

cheers
luigi


More information about the freebsd-geom mailing list