Re: [PATCH][RFC] fast file mapping for loop

From: Neil Brown
Date: Thu Jan 10 2008 - 18:01:38 EST


On Thursday January 10, jens.axboe@xxxxxxxxxx wrote:
> On Thu, Jan 10 2008, Chris Mason wrote:
> > On Thu, 10 Jan 2008 09:31:31 +0100
> > Jens Axboe <jens.axboe@xxxxxxxxxx> wrote:
> >
> > > On Wed, Jan 09 2008, Alasdair G Kergon wrote:
> > > > Here's the latest version of dm-loop, for comparison.
> > > >
> > > > To try it out,
> > > > ln -s dmsetup dmlosetup
> > > > and supply similar basic parameters to losetup.
> > > > (using dmsetup version 1.02.11 or higher)
> > >
> > > Why oh why does dm always insist to reinvent everything? That's bad
> > > enough in itself, but on top of that most of the extra stuff ends up
> > > being essentially unmaintained.
> >
> > I don't quite get how the dm version is reinventing things. They use
>
> Things like raid, now file mapping functionality. I'm sure there are
> more examples, it's how dm was always developed probably originating
> back to when they developed mostly out of tree. And I think it's a bad
> idea, we don't want duplicate functionality. If something is wrong with
> loop, fix it, don't write dm-loop.

I'm with Jens here.

We currently have two interfaces that interesting block devices can be
written for: 'dm' and 'block'.
We really should aim to have just one. I would call it 'block' and
move anything really useful from dm into block.

As far as I can tell, the important things that 'dm' has that 'block'
doesn't have are:

- a standard ioctl interface for assembling and creating interesting
devices.
For 'block', everybody just rolls there own. e.g. md, loop, and
nbd all use totally different approaches for setup and tear down
etc.

- suspend/reconfigure/resume.
This is something that I would really like to see in 'block'. If
I had a filesystem mounted on /dev/sda1 and I wanted to make it a
raid1, it would be cool if I could
suspend /dev/sda1
build a raid1 from sda1 and something else
plug tha raid1 in as 'sda1'.
resume sda1

- Integrated 'linear' mapping.
This is the bit of 'dm' that I think of as yucky. If I read the
code correctly, every dm device is a linear array of a bunch of
targets. Each target can be a stripe-set(raid0) or a multipath or
a raid1 or a plain block device or whatever.
Having 'linear' at a different level to everything else seems a
bit ugly, but it isn't really a big deal.

I would really like to see every 'dm' target being just a regular
'block' device. Then a 'linear' block device could be used to
assemble dm targets into a dm device. Or the targets could be used
directly if the 'linear' function wasn't needed.

Each target/device could respond to both dm ioctls and 'adhoc'
ioctls. That is a bit ugly, but backwards compatibility always is,
but it isn't a big cost.

I think the way forward here is to put the important
suspend/reconfig/resume functionality into the block layer, then
work on making code work with multiple ioctl interfaces.

I *don't* think the way forward is to duplicate current block devices
as dm targets. This is duplication of effort (which I admit isn't
always a bad thing) and a maintenance headache (which is).

"Help, I'm having a problem with the loop driver"
"Which one, dm or regular, because if it is the 'dm' one you have to
ask over there ..."

It has already happened occasionally with raid1 and multipath - both
of which have pointless multiple implementations.


>
> > the dmsetup command that they use for everything else and provide a
> > small and fairly clean module for bio specific loop instead of piling
> > it onto loop.c....

I'm missing something here... "fairly clean module for bio specific
loop". Isn't that what 'loop.c' is meant to be?

NeilBrown
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/