lkml.org 
[lkml]   [1999]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
From
Date
Subject[Patch] Get consistent disk paging data with /proc/stat
Hallo,

at present /proc/stat reports in the "page" line the number of calls
made to make_request. As the number of 512 bytes records belonging to one
request varies ( 2 for a normal harddisk, 4 for a SCSI CDROM,
probably 8 for a md-device), this accumulated number doesn't reflect a
real hard number tranfered to and from the media. I propose counting
the number of records instead. This would require a change to xosview,
or otherwise the numbers for normal disk accesses would off by a
factor of two.

Any objections

Bye

Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de

Free Software: If you contribute nothing, expect nothing
--


--- linux/drivers/block/ll_rw_blk.c~ Fri Mar 12 08:20:14 1999
+++ linux/drivers/block/ll_rw_blk.c Fri May 7 19:17:32 1999
@@ -415,7 +418,7 @@
case READ:
if (buffer_uptodate(bh)) /* Hmmph! Already have it */
goto end_io;
- kstat.pgpgin++;
+ kstat.pgpgin+=count;
max_req = NR_REQUEST; /* reads take precedence */
break;
case WRITEA:
@@ -429,7 +432,7 @@
* as they take precedence. The last third of the
* requests are only for reads.
*/
- kstat.pgpgout++;
+ kstat.pgpgout+=count;
max_req = (NR_REQUEST * 2) / 3;
break;
default:
--- xosview-1.7.1/linux/diskmeter.cc.orig Thu Feb 25 18:12:41 1999
+++ xosview-1.7.1/linux/diskmeter.cc Fri May 7 20:37:18 1999
@@ -73,8 +73,8 @@
// assume each "unit" is 1k.
// This is true for ext2, but seems to be 512 bytes
// for vfat and 2k for cdroms
- unsigned long int read_curr = one * 1024;
- unsigned long int write_curr = two * 1024;
+ unsigned long int read_curr = one * 512;
+ unsigned long int write_curr = two * 512;

fields_[0] = ((read_curr - read_prev_) * 1e6) / IntervalTimeInMicrosecs();
fields_[1] = ((write_curr - write_prev_) * 1e6) /
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.038 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site