Someone maintaining disk stats?

From: Daniel Kobras (kobras@tat.physik.uni-tuebingen.de)
Date: Sat Jul 29 2000 - 11:58:56 EST


Moi!

2.3.99-pre8 brought us a new and extensible form of disk statistics via
/proc/stat. That's fine as the old static 4-slot technique with
overlapping entries was definitely crap. It's not so fine anymore when you
start looking at the implementation: the stats are limited to block
devices with major numbers < 16, meaning that you get stats for your
ramdisks, loopback devices, floppies, MFM and BIOS hard drives. You don't
get stats for your second IDE controller, or my Mylex raid. You get
redundant data for /dev/md0 on /dev/sda and /dev/sdb, you don't get
anything for your logical volumes on /dev/hdc. Moreover, one third of the
entries in the dk_drive* tables in kstat will never be used because no
block devices of this major number do exist. That's 1,6kByte of kernel
memory. The dk_drive array (1kByte) just keeps the sum of dk_drive_rio
and dk_drive_wio. It's not even exported to the user.

Hence, this implementation looks inconsistent and unfortunate to me. In
the case of /dev/hdc and /dev/hdd, it even removes information that was
previously available. (Information that was actually in use. I just
realized that noflushd will no longer be able to spin down my second
hard disk on 2.4 while it works fine on 2.2.)

So is someone maintaining stat implementation? Is this work in progress?
And what about sct's sard patches that do it the sane way?

Below is a tiny patch against test4 to remove the most obvious bloat.

Regards,

Daniel.

--[snip]--

--- drivers/block/ll_rw_blk.c.clean Sat Jul 29 18:39:13 2000
+++ drivers/block/ll_rw_blk.c Sat Jul 29 18:39:31 2000
@@ -455,7 +455,6 @@
         if ((index >= DK_MAX_DISK) || (major >= DK_MAX_MAJOR))
                 return;
 
- kstat.dk_drive[major][index] += new_io;
         if (rw == READ) {
                 kstat.dk_drive_rio[major][index] += new_io;
                 kstat.dk_drive_rblk[major][index] += nr_sectors;
--- include/linux/kernel_stat.h.clean Sat Jul 29 18:39:50 2000
+++ include/linux/kernel_stat.h Sat Jul 29 18:40:09 2000
@@ -20,7 +20,6 @@
         unsigned int per_cpu_user[NR_CPUS],
                      per_cpu_nice[NR_CPUS],
                      per_cpu_system[NR_CPUS];
- unsigned int dk_drive[DK_MAX_MAJOR][DK_MAX_DISK];
         unsigned int dk_drive_rio[DK_MAX_MAJOR][DK_MAX_DISK];
         unsigned int dk_drive_wio[DK_MAX_MAJOR][DK_MAX_DISK];
         unsigned int dk_drive_rblk[DK_MAX_MAJOR][DK_MAX_DISK];

--[snap]--

-- 
	GNU/Linux Audio Mechanics - http://www.glame.de
	      GPG Key ID 89BF7E2B - http://www.keyserver.net

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



This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:30 EST