Subject: Re: kern/2679: addition of seek stat
To: None <banshee@gabriella.abattoir.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 08/09/1996 11:37:23
On Thu, 8 Aug 1996 02:41:30 -0700 (PDT) 
 John M Vinopal <banshee@gabriella.abattoir.com> wrote:

 > >Synopsis:       addition of seek stat

 > >Description:
 > 	dk_seek is not updated in subr_disk.c
 > >How-To-Repeat:
 > 	A seek could be defined as any xfer or zero byte xfer, in this 
 > 	case the following patch is appropriate.
 > >Fix:
 > *** subr_disk.c Sun Mar 17 04:28:11 1996
 > --- /tmp/a      Thu Aug  8 02:37:14 1996
 > ***************
 > *** 385,390 ****
 > --- 385,391 ----
 >                 diskp->dk_bytes += bcount;
 >                 diskp->dk_xfer++;
 >         }
 > +       diskp->dk_seek++;
 >   }

This is not really correct.  May disks do seeks independent of transfers 
(this is true for HP-IB disks, at least, and SMD, if I'm not mistaken).  
Thus, adding this would skew the seek metric, since these disks call 
disk_busy() to calculate time spent seeking (and call disk_unbusy() with 
a transfer length of 0 upon seek completion).

Charles Hannum mentioned to be in passing some months ago that an implied 
seek in disksort() might be appropriate (when disksort() rewinds to the 
beginning of the queue).  However, this too would skew the metrics of 
disks that do independent seeks.

Probably the best place to put this is in the individual drivers that 
don't do independent seeks or the drivers (like the sparc floppy driver) 
which do implied seeks.

 -- save the ancient forests - http://www.bayarea.net/~thorpej/forest/ -- 
Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939