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? -- Adam Vande More
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; -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 196 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20101125/3d78823f/attachment.pgp
On 11/25/2010 06:28, 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? >Is this on ZFS ? If that is the case it is a known problem that needs the following patch to fix the issue. http://people.freebsd.org/~avg/zfs-ru.diff I believe it is planned to be MFC'd but am not quite sure so I have CC'd Andriy and he should be able to advise further. Regards, -- jhell,v
On Thu, Nov 25, 2010 at 05:18:13PM -0600, Adam Vande More wrote:> On Thu, Nov 25, 2010 at 4:44 PM, Kostik Belousov <kostikbel@gmail.com>wrote: > > > Can you show exact command and describe some details about setup for > > the case where you still do not observe the counter in top ? > > (With my patch applied). > > > ----------------------------------------------------------------------------------------------------------------- > Still broken with patch applied; > dd if=/dev/zero of=/tmp/delete.me bs=64kWhat is /tmp/delete.me ? A file ? On what kind of filesystem is it located ? Summoning some psychic power, I can predict that delete.me is located on ZFS or tmpfs filesystem. Is this right ? If yes, then the result is expected and nothing is broken there (except ZFS, but I already described it).> > during this "top -m io" displays for dd: > 2235 adam 14 24 0 0 0 0 0.00% dd > > ----------------------------------------------------------------------------------------------------------------- > Fixed with patch applied; > > dd if=/dev/ada0 of=/dev/null bs=64k > > during this "top -m io" displays for dd: > 2248 adam 3262 0 3262 0 0 3262 100.00% dd > > > > -- > Adam Vande More-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 196 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20101125/7a3a83df/attachment.pgp