Linux Operating System Source Code: IBM Patches

 
Disk I/O statistics patch
Description:
This work is intended to extend the gathering of disk statistics to include major numbers greater than 15.

In the current implementation, the disk io statistics is done by a global static data buffer, whose size is limited by DK_MAX_MAJOR. This causes /proc/stat only reports disk io statistics for major <16.

Developer:
Mingming Cao
Status:
Submitted to project

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.

Release Notes Date Files
2.5.2 Release Notes 2002-02-01  
  File Notes   disk-stat-dk-252.patch.gz
  File Notes   disk-stat-rq-252.patch.gz

Show all releases