Skip to contentSkip to conversation

R/W disk statistics

PATCH New Andrzej Krzysztofowicz 1 participant 1 message Apr 26, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 R/W disk statistics

Quoted 1 line

From kufel!ankry Thu Apr 26 21:20:09 2001

Return-Path: <kufel!ankry>
Received: from kufel.UUCP (uucp@localhost)

	by green.mif.pg.gda.pl (8.9.3/8.9.3) with UUCP id VAA15655
	for green.mif.pg.gda.pl!ankry; Thu, 26 Apr 2001 21:20:09 +0200
Received: (from ankry@localhost)
	by kufel.dom (8.9.3/8.9.3) id VAA00689
	for ankry@green; Thu, 26 Apr 2001 21:20:17 +0200

Date: Thu, 26 Apr 2001 21:20:17 +0200
From: Andrzej Krzysztofowicz <kufel!ankry>
Message-Id: <[email protected]>
To: kufel!green.mif.pg.gda.pl!ankry
Subject: stat

Alan, Linus, lk, [email protected]
Hi,
The following patch adds more devices to the R/W statistics in /proc/stat.
It also changes slightly the format for hdc/hdd signatures in this file:

old format new format

hda     (3,0)                 same
hdb     (3,1)                 same
hdc     (22,2)                (22,0)
hdd     (22,3)                (22,1)
hde     none                  (33,0)
hdf     none                  (33,1)

It shouldn't break any tools as even the "old" format is quite new and has already significantly changed since 2.2.x (where the report was not so detailed). Having the format unchanged needs a bit more time consuming code...

md devices seem to rely on these data on sync. So lack of them may cause sync on md devices which base on either SCSI disks with number 17+ (sdq,...) or IDE disks on the 3rd+ interface (hde,...) not to be performed properly.

I did not add any non-x86 devices here, however. While the same md problems concern them also (IMHO).

linux/genhd.h renamed from linux/genhd.h~ +16 -3
diff -uNr include/linux/genhd.h~ include/linux/genhd.h
@@ -252,14 +252,27 @@
 			index = (minor & 0x00f8) >> 3;
 			break;
 		case SCSI_DISK0_MAJOR:
+		case SCSI_DISK1_MAJOR:
+		case SCSI_DISK2_MAJOR:
+		case SCSI_DISK3_MAJOR:
+		case SCSI_DISK4_MAJOR:
+		case SCSI_DISK5_MAJOR:
+		case SCSI_DISK6_MAJOR:
+		case SCSI_DISK7_MAJOR:
 			index = (minor & 0x00f0) >> 4;
 			break;
 		case IDE0_MAJOR:	/* same as HD_MAJOR */
+		case IDE1_MAJOR:
+		case IDE2_MAJOR:
+		case IDE3_MAJOR:
+		case IDE4_MAJOR:
+		case IDE5_MAJOR:
+		case IDE6_MAJOR:
+		case IDE7_MAJOR:
+		case IDE8_MAJOR:
+		case IDE9_MAJOR:
 		case XT_DISK_MAJOR:
 			index = (minor & 0x0040) >> 6;
-			break;
-		case IDE1_MAJOR:
-			index = ((minor & 0x0040) >> 6) + 2;
 			break;
 		default:
 			return 0;
Signature · 4 lines
=======================================================================
  Andrzej M. Krzysztofowicz               [email protected]
  tel.  (0-58) 347 14 61
Wydz.Fizyki Technicznej i Matematyki Stosowanej Politechniki Gdanskiej