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

From: Jens Axboe (axboe@suse.de)
Date: Wed Aug 30 2000 - 12:59:22 EDT

  • Next message: Linus Torvalds: "Re: [PATCH] af_rose.c: s/suser/capable/ + micro cleanups"

    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
    there.

    > > 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)
                            continue;
                    if (!active)
                            continue;

                    /* 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
    want.

    -- 
    * Jens Axboe <axboe@suse.de>
    * SuSE Labs
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    Please read the FAQ at http://www.tux.org/lkml/
    



    This archive was generated by hypermail 2b29 : Wed Aug 30 2000 - 13:01:59 EDT