Date: Thu, 25 Nov 2010 14:08:28 +0200 From: Kostik Belousov <kostikbel@gmail.com> To: Adam Vande More <amvandemore@gmail.com> Cc: freebsd-stable@freebsd.org, fs@freebsd.org Subject: Re: top io mode Message-ID: <20101125120828.GN2392@deviant.kiev.zoral.com.ua> In-Reply-To: <AANLkTikrKevf3x4nyi6=8Yz0BW=yZzf0W_Xa3XGQXy8N@mail.gmail.com> References: <AANLkTikrKevf3x4nyi6=8Yz0BW=yZzf0W_Xa3XGQXy8N@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Thu, Nov 25, 2010 at 05:28:30AM -0600, Adam Vande More wrote:
> top io doesn't seem to display stats when dealing direct with a block device
> like so:
>
> dd if=/dev/ada0 of=/dev/null
>
> However if dd runs on a regular file eg
>
> dd if=test.file of=/dev/null
>
> then stats are reported in top.
>
> Is this the expected behavior?
I do not think so, and the patch at the end of the message worked for me.
I cannot explain the
if (!TD_IS_IDLETHREAD(curthread))
curthread->td_ru.ru_inblock++;
checks that are done in vfs_bio.c.
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c
index d6be6e7..34072f3 100644
--- a/sys/kern/kern_physio.c
+++ b/sys/kern/kern_physio.c
@@ -57,10 +57,13 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
for (i = 0; i < uio->uio_iovcnt; i++) {
while (uio->uio_iov[i].iov_len) {
bp->b_flags = 0;
- if (uio->uio_rw == UIO_READ)
+ if (uio->uio_rw == UIO_READ) {
bp->b_iocmd = BIO_READ;
- else
+ curthread->td_ru.ru_inblock++;
+ } else {
bp->b_iocmd = BIO_WRITE;
+ curthread->td_ru.ru_oublock++;
+ }
bp->b_iodone = bdone;
bp->b_data = uio->uio_iov[i].iov_base;
bp->b_bcount = uio->uio_iov[i].iov_len;
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)
iEYEARECAAYFAkzuUbwACgkQC3+MBN1Mb4hR2gCeJPD4EX57RwABvMHlOVFQH9R7
kxgAoLT+Hl6uKW+Ku51AfM37cPRxcEUE
=WP+7
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101125120828.GN2392>
