Re: [PATCH] Fix disk statistic reporting to include all disks

From: Jens Axboe (
Date: Wed Aug 30 2000 - 11:59:22 EST

On Wed, Aug 30 2000, Bill Wilson wrote:
> Won't we loose some important info by not looking at minors? hda and
> hdb are minors of IDE0_MAJOR, etc. Is this data distinguishable in the
> queues?

hda and hdb each have their own queue, so we don't loose anything

> > No big deal, for now I just have the proc code doing blk_get_queue for
> > every major. That code is hardly performance critical ;-)
> True for the kernel, but there are some user land apps that read /proc/stat
> quite frequently (10 per second) so some performance tuning might be
> worth it. There could be a linked list field in the blk_dev[] array
> which links all entries that have had statistics collected. Then the /proc
> code does not have to blk_get_queue on every major.

Right now the code in my tree looks something like this:

        for (i = 0; i < MAX_BLKDEV; i++) {
                request_queue_t *q = blk_get_queue(MKDEV(i, 0));
                if (!q)
                if (!active)

                /* print stats */

So it's not really that bad. I suppose things could be made quicker
by just browsing a list of active queues, but I'm not sure it's worth
the trouble (but hey, proove me wrong). Note that linking blk_dev
does not make much sense, since not all queues are available from
there. Drivers are free to use their own queue, even several if they

* Jens Axboe <>
* SuSE Labs
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:25 EST