Hi Linus, Alan, All, Here is a try in the direction of moving disk statistics into the request queue. The main idea is: For each request queue,there is a pointer to a statistics structure. The statistics structure is dynamically allocated in blk_init_queue() and freed in blk_cleanup_queue(). Disk statistics gathering is easier and faster now, since less lookup is needed. In this way we extend the disk io gathering ability, dynamically allocate statistics memory for registered device only, and faster disk statistics gathering in the kernel side. However, by moving statistics into the request queue, it makes kstat_read_proc() hard (maybe slower?) to show those statistics. It is not straightforward to find out all request queues since drivers could have their own request queues. The method used in this patch is,for each major, calculates the max number of disks(by the gendisk.minor_shift), and loop around to call blk_get_queue() to lookup the request queue associated with every disk. Any suggestions on how to find out all request queues in kstat_read_proc()? The fact is, the value of max number of disks calculated through gendisk.minor_shift, may be greater than the actual max number disks defined in the driver. For example, MAX_DRIVES defined in ide.h is 2, but ide could have up to 4 disks in theory. ide_get_queue() returns one of the first two request queues when the disk index is greater than MAX_DRIVES. Thus, kstat_read_proc() will print the the statistics for ide disk2 and disk3, since to kstat_read_proc(), there are request queues associated with those disks(even if those disks are not exist). I don't know whether changing the ide_get_queue() (ide_get_queue() returns NULL if disk index is out of range) is a right way to fix this. Could break anything? Also, any other drivers have similar issues? One more thing I am not sure is, for the device which has multiple disks but only use one default request queue, there is no way to differentiate the statistics between disks; Also, gathering statistics at the partition level seems impossible, although I am not sure how important it is. Attached patch is against 2.4.14. Thanks in advance for your inputs and comments. -- Mingming Cao IBM Linux Technology Center 503-578-5024 IBM T/L: 775-5024 cmm@us.ibm.com http://www.ibm.com/linux/ltc