Notes:
Two approaches have been proposed here:
1. The first method is based on current implement. The idea of
this approach is: dynamically allocate a disk statistics structure
when a new block device is registered. A global array (kstat.dkdrive_info[MAX_DEVBLK])
is used to hold the address of the statistics structures for all
block devices. The disk statistics lookup is kept the same as before:
indexed by the major number and the disk number. Noticed that the
disk number is abstained by calling the disk_index() function. Doing
so could support disk statistics for every major without cost too
much memory.
The discussions on linux kernel mail list can be found in the
archives:
2. The second way to do statistics for all disks is, moving statistics
data into request queue structure. The statistics data structure
is allocated and initialized when the corresponding block request
queue is initialized. Every device has a request queue associated
with it. In this way the statistics information is self-contained
in the controller itself, and it avoid the lookup when doing the
statistics, since the request queue data structure is already there
when the statistics is about to collect.
Patch was created and posted to linux kernel mail list and lse-tech
mail list. View the discussion in the
archives.
Please visit
http://lse.sourceforge.net/resource/diskio/diskio.html
for more
information.
|