Re: [dm-devel] REQUEST for new 'topology' metrics to be moved outof the 'queue' sysfs directory.

From: Neil Brown
Date: Sat Jun 27 2009 - 08:32:35 EST


On Friday June 26, jens.axboe@xxxxxxxxxx wrote:
> On Fri, Jun 26 2009, NeilBrown wrote:
> > On Fri, June 26, 2009 10:50 pm, Jens Axboe wrote:
> > > On Fri, Jun 26 2009, Neil Brown wrote:
> > >> Every block device has a 'gendisk' (aka generic disk).
> > >> Every block device also (currently) has a request_queue.
> > >
> > > I don't know why you keep saying currently. It has always had a queue,
> > > and I don't see a good reason why that should change for "special" block
> > > devices like md/dm/loop/whatnot.
> >
> > I say "currently" because I'm planning to create patches to make it
> > optional, and I want to get you used to the idea :-)
> >
> > And md/dm/loop/whatnot are not "special" block devices, any more than
> > scsi/ide are "special" block devices. They are all just block devices.
> > They use different mechanisms, but each is just as valid as the other.
>
> That was why I put it in quotes, they are just regular devices.

Ahh... I missed your point. You were saying that they aren't special,
they are just like everything else and so should still have a queue.
Sorry for misunderstanding.
See below for my response.

>
> > The current code makes 'struct request' based block devices in to
> > first-class citizens, and all the rest are second class (having to
> > tag our data structures on ->queue data and/or ->private_data).
>
> ?? How is that different from devices, the ones you refer to as
> first-class citizens? They too store device private data in eg
> ->queue_data.
>
> > I just want all block devices to be equal.
>
> There's no such thing as first or second class block devices. The fact
> that drivers using ->make_request_fn directly do not utilize the full
> scope of the queue isn't a very interesting fact, imho.

Your phrase "drivers using ->make_request_fn directly" seems to
suggest you are looking at things very differently to me.

From my perspective, all drivers use ->make_request_fn equally.
Some set it to "__make_request", some to "md_make_request", others to
"dm_request" or "loop_make_request" etc.

Each of these different drivers need some private storage.
__make_request uses struct request_queue
md_make_request uses struct mddev_s
dm_request uses struct mapped_device
loop_make_request uses struct loop_device
etc

These structures are all attached to gendisk one way or another.

Of these examples, the first three have an extra level. They are
intermediaries or "midlayers" for multiple drivers and perform some
processing before passing the request down.
__make_request provides this for ide and scsi (etc) via ->request_fn and
->queuedata in struct request_queue (and other fields).
md_make_request provides this for raid1 and raid5 (etc) via
->pers->make_request and ->private is struct mddev_s (and other
fields).
dm_request provides this for crypt and multipath (etc) via
->map->targets[]->type->map and ->map->targets[]->private (and
other fields).

Looked at from this perspective, the fact that some drivers 'do not
utilise the full scope of the queue' certainly isn't the interesting
point. The interesting point is that they have to use parts of the
queue at all.

And from this perspective, __make_request is a class above everything
else. __make_request gets a dedicate field in gendisk (->queue) and
every driver has to provide a queue. Other (lower class) drivers get
to share gendisk->private_date and/or gendisk->queue->queuedata.


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/