Subject: kern/3031: iostat disk statistics are worse than ever
To: None <gnats-bugs@gnats.netbsd.org>
From: Lennart Augustsson <augustss@cs.chalmers.se>
List: netbsd-bugs
Date: 12/15/1996 19:45:34
>Number:         3031
>Category:       kern
>Synopsis:       iostat disk statistics are worse than ever
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 15 15:20:00 1996
>Last-Modified:
>Originator:     Lennart Augustsson
>Organization:
Department of Computing Science, Chalmers University
>Release:        NetBSD-current 961213
>Environment:
System: NetBSD calvin.cs.chalmers.se 1.2B NetBSD 1.2B (CALVIN) #42: Sun Dec 15 19:33:48 MET 1996 augustss@calvin.cs.chalmers.se:/usr/src/sys/arch/i386/compile/CALVIN i386


>Description:
	The KB/t and MB/s columns in iostat show values that are
	off by a factor of 8 (at least for some examples).
	The problem is the kernel disk statistics.
>How-To-Repeat:
	Use some program that tells you the real transfer rate and
	compare with the far too low figures from iostat.
	dd should work; I use a program that plays CD sound from
	disk.
>Fix:
	Well, I don't know if this is a fix that will be approved, but
	it fixes the problem, so it may give someone (Jason?) a clue
	to the real fix.

*** /usr/src/sys/scsi/sd.c.old  Sun Dec 15 17:27:29 1996
--- /usr/src/sys/scsi/sd.c      Sun Dec 15 19:37:44 1996
***************
*** 635,641 ****
        struct sd_softc *sd = xs->sc_link->device_softc;

        if (complete && (xs->bp != NULL))
!               disk_unbusy(&sd->sc_dk, (xs->bp->b_bcount - xs->bp->b_resid));

        return (0);
  }
--- 635,641 ----
        struct sd_softc *sd = xs->sc_link->device_softc;

        if (complete && (xs->bp != NULL))
!               disk_unbusy(&sd->sc_dk, xs->datalen);

        return (0);
  }

>Audit-Trail:
>Unformatted: