Solaris 2.x compat. system accounting, sarcheck for fbsd(commercial)

Dan Nelson dnelson at allantgroup.com
Fri Apr 11 20:04:40 PDT 2003


In the last episode (Apr 11), Terry Lambert said:
> In theory, this could be fixed, you're saying.  I don't believe this. 
> You need to know that a particular I/O as a result of a page fault is
> a result of a process, rather than system (e.g. swapping).  Because
> the VM and buffer cache is unified, you can't do this.  In SVR4, you
> know because you know the buffer cache operation is waiting on a VM
> operation, and buffers are attributable to processes.  See what I
> mean?

You could disguingish "idle" vs "i/o wait" per-process by classifying
all the wait channels, couldn't you?  I'd guess that anything in
/sys/vm/* and /sys/*fs/* could be called i/o wait, for starters. 
Another possibility is by sleep priority.  PSWP, PVM, PINOD, PRIBIO,
and PVFS all look like they're in the i/o category.

If you're about to do cp_time[CP_IDLE]++ in kern_clock.c, just scan the
process list and look for a process in one of the i/o-wait wchans.  If
you find one, increment CP_IOWAIT instead.  Sure, you may have to lock
allproc, but key, you're already idle :)
 
-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-hackers mailing list